Skip to content

Commit

Permalink
[FINNA-2737] Quria: Fix placing holds on journals (#3063)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajaro authored Oct 24, 2024
1 parent 5db730d commit 0f0a928
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions module/Finna/src/Finna/ILS/Driver/Quria.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -422,7 +429,6 @@ protected function parseHoldings($organisationHoldings, $id, $journalInfo = null
" for '$this->arenaMember'.'$id'"
);
}
$holdable = ($branch->reservationButtonStatus ?? '') === 'reservationOk';
$requests = 0;
if (
!$this->singleReservationQueue
Expand Down

0 comments on commit 0f0a928

Please sign in to comment.