Bug 33198

Summary: request.pl is calculating pickup locations that are not used
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Hold requestsAssignee: Nick Clemens (kidclamp) <nick>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, gmcharlt, jonathan.druart, Laura.escamilla, lucas, matt.blenkinsop, michaela.sieber, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05,22.05.12
Circulation function:
Attachments: Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds
Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds
Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds

Description Nick Clemens (kidclamp) 2023-03-10 18:44:03 UTC
One systems with many branches, or complex rules calculating the pickup locations can be expensive.

It appears we are calling $biblio->pickup_locations that is only used during multi-holds for all of our holds
Comment 1 Nick Clemens (kidclamp) 2023-03-10 18:46:39 UTC
Created attachment 148096 [details] [review]
Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds

For single bibs we use an ajax select2 dropdown, and we don't use this
value

To test:
1 - Place some holds on single bibs
2 - Confirm dropdowns for pickup location work as expected
3 - Do the same for multiple bibs selected from search results
4 - Apply patch
5 - Confirm there is no change after the patch
Comment 2 Tomás Cohen Arazi (tcohen) 2023-03-13 15:36:30 UTC
Created attachment 148126 [details] [review]
Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds

For single bibs we use an ajax select2 dropdown, and we don't use this
value

To test:
1 - Place some holds on single bibs
2 - Confirm dropdowns for pickup location work as expected
3 - Do the same for multiple bibs selected from search results
4 - Apply patch
5 - Confirm there is no change after the patch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Jonathan Druart 2023-03-22 13:16:39 UTC
Created attachment 148532 [details] [review]
Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds

For single bibs we use an ajax select2 dropdown, and we don't use this
value

To test:
1 - Place some holds on single bibs
2 - Confirm dropdowns for pickup location work as expected
3 - Do the same for multiple bibs selected from search results
4 - Apply patch
5 - Confirm there is no change after the patch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-03-27 10:06:28 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 5 Laura Escamilla 2023-04-06 10:56:49 UTC
Can this be considered for backport?
Comment 6 Matt Blenkinsop 2023-04-11 09:01:50 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 7 Lucas Gass (lukeg) 2023-04-24 17:04:09 UTC
Backported to 22.05.x for upcoming 22.05.12
Comment 8 Arthur Suzuki 2023-05-03 18:39:59 UTC
applied to 21.11.x for 21.11.20