Skip to content
Snippets Groups Projects
Commit d1f9e064 authored by Robert Lange's avatar Robert Lange
Browse files

Merge branch 'instance/fid' into instance/fid_bbi

parents 5a496e5e d138dac8
No related merge requests found
......@@ -105,7 +105,9 @@ class MyResearchController extends \VuFind\Controller\MyResearchController
try {
$library = $this->getHomeLibrary($patron);
$view->homeLibrary = $library->getDbis();
if (!is_null($library)) {
$view->homeLibrary = $library->getDbis();
}
$view->map_bibid_to_dbis = false;
} catch (ClientException $exception) {
// TODO: Implement logging (in database?)
......@@ -159,14 +161,14 @@ class MyResearchController extends \VuFind\Controller\MyResearchController
protected function getHomeLibrary($patron): ?Library
{
if (is_a($patron['user'], 'fid\Service\DataTransferObject\User')
&& $patron['user']->getHomeLibrary())
&& $homeLibrary = $patron['user']->getHomeLibrary())
{
if (isset($patron['libs'][$patron['user']->getHomeLibrary()])) {
return $patron['libs'][$patron['user']->getHomeLibrary()];
if (isset($patron['libs'][$homeLibrary])) {
return $patron['libs'][$homeLibrary];
}
/* no home library found in patron object? => fetch library from api directly */
return $this->fidClient->requestLibraryById($patron['user']->getHomeLibrary());
return $this->fidClient->requestLibraryById($homeLibrary);
}
return null;
......
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