Skip to content
Snippets Groups Projects
Commit 388dcf55 authored by André Lahmann's avatar André Lahmann Committed by Robert Lange
Browse files

refs #23953 [finc] added some missing code fragements from VF7

parent 894f36b1
No related merge requests found
......@@ -123,7 +123,7 @@ class MyResearchController extends \VuFind\Controller\MyResearchController imple
// If we got this far, we just need to display the favorites:
try {
$runner = $this->serviceLocator->get('VuFind\Search\SearchRunner');
$runner = $this->serviceLocator->get(\VuFind\Search\SearchRunner::class);
// We want to merge together GET, POST and route parameters to
// initialize our search object:
......@@ -133,7 +133,7 @@ class MyResearchController extends \VuFind\Controller\MyResearchController imple
// Set up listener for recommendations:
$rManager = $this->serviceLocator
->get('VuFind\Recommend\PluginManager');
->get(\VuFind\Recommend\PluginManager::class);
$setupCallback = function ($runner, $params, $searchId) use ($rManager) {
$listener = new RecommendListener($rManager, $searchId);
$listener->setConfig(
......@@ -143,8 +143,17 @@ class MyResearchController extends \VuFind\Controller\MyResearchController imple
};
$results = $runner->run($request, 'Favorites', $setupCallback);
$listTags = [];
if ($this->listTagsEnabled()) {
if ($list = $results->getListObject()) {
foreach ($list->getListTags() as $tag) {
$listTags[$tag->id] = $tag->tag;
}
}
}
return $this->createViewModel(
['params' => $results->getParams(), 'results' => $results, 'context' => "favorite"]
['params' => $results->getParams(), 'results' => $results, 'listTags' => $listTags, 'context' => "favorite"]
);
} catch (ListPermissionException $e) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment