Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FINNA-2726] Quria: Fix updating holds when pick up location is not changed #3060

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions module/Finna/src/Finna/ILS/Driver/Quria.php
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,14 @@ public function updateHolds(
if (isset($fields['pickUpLocation'])) {
[, $branch] = explode('.', $fields['pickUpLocation'], 2);
$updateRequest['pickUpBranchId'] = $branch;
} else {
$locations = $this->getPickUpLocations($patron, ['item_id' => $requestId]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mitä tässä tapahtuu? Eikö $pickupLocation sisällä jo nykyisen pickUpBranchId:n (riviltä 987)? Miksei sitä voi käyttää suoraan?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ei. Toi rivin 987 $reservation->pickUpBranchId antaa käytännössä esim. "Palosaaren kirjasto" eli locationDisplay:n

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sehän onkin sitten ihan tosi outo. Lisäisitkö vaikka molempiin kohtiin vielä kommentit, niin ei tarvitsisi ihmetellä? Tyyliin // $reservation->pickUpBranchId actually contains the branch name instead of the ID riville 987 ja // Map the branch name to an actual branch ID tähän uuteen.

foreach ($locations as $loc) {
if ($loc['locationDisplay'] === $pickupLocation) {
[, $branch] = explode('.', $loc['locationID'], 2);
$updateRequest['pickUpBranchId'] = $branch;
}
}
}
$result = $this->doSOAPRequest(
$this->reservations_wsdl,
Expand Down
Loading