Bug 36362 - Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Summary: Only call Koha::Libraries->search() if necessary in Item::pickup_locations
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: David Gustafsson
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 17:32 UTC by David Gustafsson
Modified: 2024-09-18 04:03 UTC (History)
5 users (show)

See Also:
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 (2.57 KB, patch)
2024-03-19 17:35 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations (2.56 KB, patch)
2024-03-19 17:37 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations (2.65 KB, patch)
2024-05-09 10:31 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 36362: Only call Koha::Libraries->search() if necessary in Item::pickup_locations (2.69 KB, patch)
2024-07-19 16:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 36362: (QA follow-up) Tidy code (2.87 KB, patch)
2024-07-19 16:36 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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