Bug 35702

Summary: Reduce DB calls when performing authorities merge
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Architecture, internals, and plumbingAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to oldstable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, lucas, mengu
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.05.00,23.11.02,23.05.09
Circulation function:
Attachments: Bug 35702: Use framework code from biblio object
Bug 35702: Fetch biblios at once and loop
Bug 35702: Use framework code from biblio object
Bug 35702: Fetch biblios at once and loop
Bug 35702: Use framework code from biblio object
Bug 35702: Fetch biblios at once and loop

Description Nick Clemens (kidclamp) 2024-01-04 15:13:09 UTC
We are individually fetching each biblio, we can do this in a single call

We also fetch the frameworkcode from the DB for each biblio - we can just use the field from the object we have already fetched
Comment 1 Nick Clemens (kidclamp) 2024-01-04 15:15:15 UTC
Created attachment 160537 [details] [review]
Bug 35702: Use framework code from biblio object
Comment 2 Nick Clemens (kidclamp) 2024-01-04 15:15:17 UTC
Created attachment 160538 [details] [review]
Bug 35702: Fetch biblios at once and loop

Test plan:
prove -v t/db_dependent/Authority/Merge.t
Comment 3 David Nind 2024-01-06 18:30:05 UTC
Created attachment 160596 [details] [review]
Bug 35702: Use framework code from biblio object

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2024-01-06 18:30:07 UTC
Created attachment 160597 [details] [review]
Bug 35702: Fetch biblios at once and loop

Test plan:
prove -v t/db_dependent/Authority/Merge.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Jonathan Druart 2024-01-12 09:04:43 UTC
Created attachment 160900 [details] [review]
Bug 35702: Use framework code from biblio object

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2024-01-12 09:04:46 UTC
Created attachment 160901 [details] [review]
Bug 35702: Fetch biblios at once and loop

Test plan:
prove -v t/db_dependent/Authority/Merge.t

Signed-off-by: David Nind <david@davidnind.com>

Amended-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Replace $biblio->id with $biblio->biblionumber

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2024-01-12 09:04:57 UTC
I have replaced $biblio->id with $biblio->biblionumber.
I don't think we should add confusion (especially for newcomers) and use both id and biblionumber.

If we want to move to id we can have a vote and decide. But that's not a discussion for here nor now.
Comment 8 Katrin Fischer 2024-01-16 11:09:41 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-01-17 09:25:45 UTC
Pushed to 23.11.x for 23.11.02
Comment 10 Lucas Gass (lukeg) 2024-02-02 16:31:38 UTC
Backported to 23.05.x for upcoming 23.05.09