Bug 36362

Summary: Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Product: Koha Reporter: David Gustafsson <glasklas>
Component: Architecture, internals, and plumbingAssignee: David Gustafsson <glasklas>
Status: Pushed to oldstable --- QA Contact: Kyle M Hall (khall) <kyle>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, lucas, martin.renvoize, matt.blenkinsop, wainuiwitikapark
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:
24.11.00,24.05.04,23.11.09
Circulation function:
Attachments: Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Bug 36362: (QA follow-up) Tidy code

Description David Gustafsson 2024-03-19 17:32:38 UTC
In Item::pickup_locations; instead of setting the default value of $pickup_libraries to Koha::Libraries->search(), that call should only be made if that variable is not set to something else. A rather small and probably that not significant fix in terms of performance, but also an easy thing to fix.
Comment 1 David Gustafsson 2024-03-19 17:35:37 UTC
Created attachment 163467 [details] [review]
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations

To test:

1) Make sure the following tests pass:
 - t/db_dependent/Koha/Item.t
 - t/db_dependent/Koha/Biblios.t
 - db_dependent/Koha/Biblio.t

 Sponsored-by: Gothenburg University Library
Comment 2 David Gustafsson 2024-03-19 17:37:25 UTC
Created attachment 163468 [details] [review]
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations

To test:

1) Make sure the following tests pass:
 - t/db_dependent/Koha/Item.t
 - t/db_dependent/Koha/Biblios.t
 - db_dependent/Koha/Biblio.t

 Sponsored-by: Gothenburg University Library
Comment 3 Matt Blenkinsop 2024-05-09 10:31:53 UTC
Created attachment 166451 [details] [review]
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations

To test:

1) Make sure the following tests pass:
 - t/db_dependent/Koha/Item.t
 - t/db_dependent/Koha/Biblios.t
 - db_dependent/Koha/Biblio.t

 Sponsored-by: Gothenburg University Library

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 4 Kyle M Hall (khall) 2024-07-19 16:36:05 UTC
Created attachment 169249 [details] [review]
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations

To test:

1) Make sure the following tests pass:
 - t/db_dependent/Koha/Item.t
 - t/db_dependent/Koha/Biblios.t
 - db_dependent/Koha/Biblio.t

 Sponsored-by: Gothenburg University Library

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall (khall) 2024-07-19 16:36:31 UTC
Created attachment 169250 [details] [review]
Bug 36362: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Martin Renvoize (ashimema) 2024-07-25 10:19:26 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 7 Lucas Gass (lukeg) 2024-08-29 14:03:21 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 8 Fridolin Somers 2024-09-10 14:21:36 UTC
Pushed to 23.11.x for 23.11.09
Comment 9 Wainui Witika-Park 2024-09-18 04:03:51 UTC
Not backporting to 23.05.x unless requested