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> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> (cherry picked from commit1847e2ab56) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commitfa443bcef1) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
fc0efe7909
commit
e1fcd24cd3
|
|
@ -1494,9 +1494,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) {
|
||||
|
|
@ -1570,7 +1571,7 @@ sub merge {
|
|||
}
|
||||
}
|
||||
next if !$update;
|
||||
ModBiblio($marcrecord, $biblionumber, $biblio->frameworkcode);
|
||||
ModBiblio($marcrecord, $biblio->biblionumber, $biblio->frameworkcode);
|
||||
$counteditedbiblio++;
|
||||
}
|
||||
return $counteditedbiblio;
|
||||
|
|
|
|||
Loading…
Reference in New Issue