From 77d9bfb93bf1829f903811c75f43cbf154897ff3 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 14 Sep 2023 09:11:56 +0000 Subject: [PATCH] Bug 34786: after_biblio_action hooks - No find when action is delete Test plan: Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit ac7581e90a79961a4de915f0592834eb9f2611c5) Signed-off-by: Fridolin Somers (cherry picked from commit 4aedaed0bc07160b2ca387c9bd08faa741746fa2) Signed-off-by: Matt Blenkinsop --- C4/Biblio.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 1c9cab874e..03f0ff1d1f 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -3158,9 +3158,9 @@ sub _after_biblio_action_hooks { my ( $args ) = @_; my $biblio_id = $args->{biblio_id}; - my $action = $args->{action}; + my $action = $args->{action} // q{}; - my $biblio = Koha::Biblios->find( $biblio_id ); + my $biblio = $action ne 'delete' ? Koha::Biblios->find($biblio_id) : undef; Koha::Plugins->call( 'after_biblio_action', { -- 2.39.5