Bugzilla – Attachment 160597 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.38 KB, created by
David Nind
on 2024-01-06 18:30:07 UTC
(
hide
)
Description:
Bug 35702: Fetch biblios at once and loop
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-01-06 18:30:07 UTC
Size:
1.38 KB
patch
obsolete
>From dfee8c6a7f388f21283563153e1826c94d8cc522 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 > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/AuthoritiesMarc.pm | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 7319d0e425..c787c68f7e 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