Skip to content

Commit

Permalink
Avoid error in MultiBackend driver when a hold has no id field. (#1999)
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Jun 22, 2021
1 parent 25b8e8f commit adf9edc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php
Expand Up @@ -757,11 +757,14 @@ public function checkStorageRetrievalRequestIsValid($id, $data, $patron)
*/
public function getPickUpLocations($patron = false, $holdDetails = null)
{
$source = $this->getSource($patron['cat_username'] ?? $holdDetails['id']);
$source = $this->getSource(
$patron['cat_username'] ?? $holdDetails['id'] ?? $holdDetails['item_id']
?? ''
);
$driver = $this->getDriver($source);
if ($driver) {
if ($holdDetails) {
if (!$this->driverSupportsSource($source, $holdDetails['id'])) {
if ($id = ($holdDetails['id'] ?? $holdDetails['item_id'] ?? '')) {
if (!$this->driverSupportsSource($source, $id)) {
// Return empty array since the sources don't match
return [];
}
Expand Down

0 comments on commit adf9edc

Please sign in to comment.