Bug 27895 - Internal server error when trying to change pickup location for a hold with no valid locations
Summary: Internal server error when trying to change pickup location for a hold with n...
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 31169
Blocks:
  Show dependency treegraph
 
Reported: 2021-03-08 14:27 UTC by Nick Clemens
Modified: 2023-07-04 21:07 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 27895: Unit test (1.28 KB, patch)
2021-03-08 14:27 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 27895: Prepare pickup locations for overridden holds (3.22 KB, patch)
2021-10-06 12:07 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-03-08 14:27:09 UTC
If 'AllowHoldPolicyOverride' is set to 'Allow' staff can place a hold that has no allowed pickup locations.

If staff try to alter the pickup location from the patron's record there is an internal server error

To test:
1 - Set 'Default checkout, hold and return policy' on Admin->Circ rules to
   Hold policy: From home library
   Hold pickup library match: Item's home library
2 - Set  AllowHoldPolicyOverride to Allow
3 - Place an item level hold for a patron on an item from another branch - there should be a warn while placing, but hold is allowed
4 - Bring up the patron details or checkout page
5 - Click the holds tab
6 - Try to change the hold pickup location
7 - You get an error: There was an error:error Internal Server Error
8 - In logs:
The method Koha::Libraries->branchcode is not covered by tests!

Trace begun at /kohadevbox/koha/Koha/Objects.pm line 592
Koha::Objects::AUTOLOAD('Koha::Libraries=HASH(0x5631e45dc298)') called at /kohadevbox/koha/Koha/Hold.pm line 252
Koha::Hold::__ANON__ at /kohadevbox/koha/Koha/Hold.pm line 252
Koha::Hold::is_pickup_location_valid('Koha::Hold=HASH(0x5631e448ae48)', 'HASH(0x5631e45cf638)') called at t/db_dependent/Koha/Hold.t line 203
Comment 1 Nick Clemens 2021-03-08 14:27:37 UTC
Created attachment 117923 [details] [review]
Bug 27895: Unit test
Comment 2 Nick Clemens 2021-10-06 12:07:37 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2021-10-07 07:11:49 UTC
Patches are on the wrong reports ??
Comment 4 Katrin Fischer 2023-07-04 21:07:31 UTC
Nick, can you have a look at the patches attached here please?