Skip to content

Commit 66e97d1

Browse files
authored
Merge pull request #104 from beluga-core/develop-5
Bugfix: catch error to prevent ajax call from failure.
2 parents 7f4827a + 754a05a commit 66e97d1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ private function checkParentId($driver) {
190190
}
191191
}
192192
if (!empty($parentId)) {
193-
$parentDriver = $this->recordLoader->load($parentId, 'Solr');
194-
$ilnMatch = $parentDriver->getMarcData('ILN');
195-
if (!empty($ilnMatch[0]['iln']['data'][0])) {
196-
$urlAccess = '/vufind/Record/' . $parentId;
197-
}
193+
try {
194+
$parentDriver = $this->recordLoader->load($parentId, 'Solr');
195+
$ilnMatch = $parentDriver->getMarcData('ILN');
196+
if (!empty($ilnMatch[0]['iln']['data'][0])) {
197+
$urlAccess = '/vufind/Record/' . $parentId;
198+
}
199+
} catch (\Exception $e) {
200+
}
198201
}
199202
return $urlAccess;
200203
}

0 commit comments

Comments
 (0)