From e5b86bb23a2941ebf9dce50accfd214f7c610058 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 11 Oct 2024 13:11:10 +0000 Subject: [PATCH] Bug 30648: Tidy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Anneli Österman Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- C4/Biblio.pm | 7 ++++--- installer/data/mysql/atomicupdate/bug_30648.pl | 6 +++--- t/db_dependent/Biblio.t | 2 +- t/lib/TestBuilder.pm | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 1a88d52bdb..6c62b21311 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -554,12 +554,13 @@ sub DelBiblio { # We delete any existing holds my $holds = $biblio->holds; - $holds->update({ deleted_biblionumber => $biblionumber }, { no_triggers => 1 }); + $holds->update( { deleted_biblionumber => $biblionumber }, { no_triggers => 1 } ); my $old_holds = $biblio->old_holds; - $old_holds->update({ deleted_biblionumber => $biblionumber }, { no_triggers => 1 }); + $old_holds->update( { deleted_biblionumber => $biblionumber }, { no_triggers => 1 } ); while ( my $hold = $holds->next ) { + # no need to update the holds queue on each step, we'll do it at the end - $hold->cancel({ skip_holds_queue => 1 }); + $hold->cancel( { skip_holds_queue => 1 } ); } # We update any existing orders diff --git a/installer/data/mysql/atomicupdate/bug_30648.pl b/installer/data/mysql/atomicupdate/bug_30648.pl index 32f7b586bb..80d7c842a1 100755 --- a/installer/data/mysql/atomicupdate/bug_30648.pl +++ b/installer/data/mysql/atomicupdate/bug_30648.pl @@ -2,11 +2,11 @@ use Modern::Perl; use Koha::Installer::Output qw(say_warning say_failure say_success say_info); return { - bug_number => "30648", + bug_number => "30648", description => "Store biblionumber of deleted record in old reserves", - up => sub { + up => sub { my ($args) = @_; - my ($dbh, $out) = @$args{qw(dbh out)}; + my ( $dbh, $out ) = @$args{qw(dbh out)}; if ( !column_exists( 'reserves', 'deleted_biblionumber' ) ) { $dbh->do( diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 35df97fd0b..3e3c6d4a1e 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -697,7 +697,7 @@ subtest 'DelBiblio' => sub { } ); - C4::Biblio::DelBiblio($biblio->biblionumber); + C4::Biblio::DelBiblio( $biblio->biblionumber ); $old_hold->discard_changes(); $hold = Koha::Old::Holds->find( $hold->reserve_id ); ok( $hold, "Hold has been successfully cancelled on deletion of biblio" ); diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 0124fe55b0..dc38cd5ae9 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -628,13 +628,13 @@ sub _gen_default_values { opacusercss => q{}, }, Reserve => { - non_priority => 0, - item_group_id => undef, + non_priority => 0, + item_group_id => undef, deleted_biblionumber => undef, }, OldReserve => { - non_priority => 0, - item_group_id => undef, + non_priority => 0, + item_group_id => undef, deleted_biblionumber => undef, }, Itemtype => { -- 2.39.5