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: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Gustafsson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 17:32 UTC by David Gustafsson
Modified: 2024-05-09 10:40 UTC (History)
1 user (show)

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


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

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>