Bugzilla – Attachment 160538 Details for
Bug 35702
Reduce DB calls when performing authorities merge
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35702: Fetch biblios at once and loop
Bug-35702-Fetch-biblios-at-once-and-loop.patch (text/plain), 1.34 KB, created by
Nick Clemens (kidclamp)
on 2024-01-04 15:15:17 UTC
(
hide
)
Description:
Bug 35702: Fetch biblios at once and loop
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-01-04 15:15:17 UTC
Size:
1.34 KB
patch
obsolete
>From 3e75f79a279d0bbd6e48a78f85534e11df42bf58 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 4 Jan 2024 14:07:11 +0000 >Subject: [PATCH] Bug 35702: Fetch biblios at once and loop > >Test plan: >prove -v t/db_dependent/Authority/Merge.t >--- > C4/AuthoritiesMarc.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 7319d0e4256..c787c68f7e8 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1571,9 +1571,10 @@ sub merge { > : { map { ( $_->[0], 1 ); } ( @record_from, @record_to ) }; > > my $counteditedbiblio = 0; >- foreach my $biblionumber ( @biblionumbers ) { >- my $biblio = Koha::Biblios->find($biblionumber); >- next unless $biblio; >+ >+ my $biblios = Koha::Biblios->search({ biblionumber => { -in => \@biblionumbers } }); >+ >+ while ( my $biblio = $biblios->next ) { > my $marcrecord = $biblio->metadata->record; > my $update = 0; > foreach my $tagfield (@$tags_using_authtype) { >@@ -1647,7 +1648,7 @@ sub merge { > } > } > next if !$update; >- ModBiblio($marcrecord, $biblionumber, $biblio->frameworkcode); >+ ModBiblio($marcrecord, $biblio->id, $biblio->frameworkcode); > $counteditedbiblio++; > } > return $counteditedbiblio; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35702
:
160537
|
160538
|
160596
|
160597
|
160900
|
160901