diff --git a/module/Finna/src/Finna/ILS/Driver/AxiellWebServices.php b/module/Finna/src/Finna/ILS/Driver/AxiellWebServices.php index 1da31a61578..718e96b007f 100644 --- a/module/Finna/src/Finna/ILS/Driver/AxiellWebServices.php +++ b/module/Finna/src/Finna/ILS/Driver/AxiellWebServices.php @@ -1120,11 +1120,11 @@ public function getHolding($id, array $patron = null, array $options = []) * * @param array $organisationHoldings Organisation holdings * @param string $id The record id to retrieve the holdings - * @param array $journalInfo Jornal information + * @param ?array $journalInfo Jornal information * * @return array */ - protected function parseHoldings($organisationHoldings, $id, $journalInfo = null) + protected function parseHoldings(array $organisationHoldings, string $id, ?array $journalInfo = null) { if ($organisationHoldings[0]->status == 'noHolding') { return []; diff --git a/module/Finna/src/Finna/ILS/Driver/Quria.php b/module/Finna/src/Finna/ILS/Driver/Quria.php index b8ceeefa8c8..bb062ce1110 100644 --- a/module/Finna/src/Finna/ILS/Driver/Quria.php +++ b/module/Finna/src/Finna/ILS/Driver/Quria.php @@ -318,7 +318,12 @@ public function getHolding($id, array $patron = null, array $options = []) } } } else { - $result = $this->parseHoldings($holdings, $id); + $result = $this->parseHoldings( + $holdings, + $id, + null, + (string)($response->$functionResult->catalogueRecordDetail->reservable ?? '') + ); } if (!empty($result)) { @@ -333,14 +338,19 @@ public function getHolding($id, array $patron = null, array $options = []) /** * This is responsible for iterating the organisation holdings * - * @param array $organisationHoldings Organisation holdings - * @param string $id The record id to retrieve the holdings - * @param array $journalInfo Jornal information + * @param array $organisationHoldings Organisation holdings + * @param string $id The record id to retrieve the holdings + * @param ?array $journalInfo Jornal information + * @param ?string $reservable Is the record reservable * * @return array */ - protected function parseHoldings($organisationHoldings, $id, $journalInfo = null) - { + protected function parseHoldings( + array $organisationHoldings, + string $id, + ?array $journalInfo = null, + ?string $reservable = null + ) { $result = []; foreach ($organisationHoldings as $organisation) { $holdingsBranch = $journalInfo === null @@ -354,7 +364,7 @@ protected function parseHoldings($organisationHoldings, $id, $journalInfo = null $holdable = $journalInfo['holdable']; } else { $reservableId = $branch->reservable ?? ''; - $holdable = ($branch->reservationButtonStatus ?? '') == 'reservationOk'; + $holdable = $reservable === 'yes'; } $departments = $this->objectToArray($branch->holdings->holding ?? []); $organisationId = $branch->id ?? '';