From 0f0a92803f198c34204979fae0fec3042c2f08cc Mon Sep 17 00:00:00 2001 From: rajaro Date: Thu, 24 Oct 2024 13:32:54 +0300 Subject: [PATCH] [FINNA-2737] Quria: Fix placing holds on journals (#3063) --- module/Finna/src/Finna/ILS/Driver/Quria.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/module/Finna/src/Finna/ILS/Driver/Quria.php b/module/Finna/src/Finna/ILS/Driver/Quria.php index d6253dfb057..c52878805ca 100644 --- a/module/Finna/src/Finna/ILS/Driver/Quria.php +++ b/module/Finna/src/Finna/ILS/Driver/Quria.php @@ -302,6 +302,8 @@ public function getHolding($id, array $patron = null, array $options = []) $journalInfo = [ 'year' => $year, 'edition' => $edition, + 'holdable' => ($holdingsEdition->reservationButtonStatus ?? '') == 'reservationOk', + 'reservableId' => $holdingsEdition->reservable ?? '', ]; $result = array_merge( @@ -347,8 +349,13 @@ protected function parseHoldings($organisationHoldings, $id, $journalInfo = null foreach ($holdingsBranch as $branch) { $branchName = $branch->value ?? ''; $branchId = $branch->id ?? ''; - $reservableId = $branch->reservable ?? ''; - $holdable = $branch->reservationButtonStatus ?? '' == 'reservationOk'; + if ($journalInfo) { + $reservableId = $journalInfo['reservableId']; + $holdable = $journalInfo['holdable']; + } else { + $reservableId = $branch->reservable ?? ''; + $holdable = ($branch->reservationButtonStatus ?? '') == 'reservationOk'; + } $departments = $this->objectToArray($branch->holdings->holding ?? []); $organisationId = $branch->id ?? ''; foreach ($departments as $department) { @@ -422,7 +429,6 @@ protected function parseHoldings($organisationHoldings, $id, $journalInfo = null " for '$this->arenaMember'.'$id'" ); } - $holdable = ($branch->reservationButtonStatus ?? '') === 'reservationOk'; $requests = 0; if ( !$this->singleReservationQueue