From e114b84ab4fb8e26684652a1f4d35a7a5594f224 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Tue, 19 May 2020 12:06:47 +0100 Subject: [PATCH] Bug 24190: (follow-up) Cancel order del item bug If an order is cancelled but the associated bib / items are unable to be removed, we go into error handling. We still need to log the cancellation though. So this fix moves the logging to just after the cancellation, so it will be logged regardless of the outcome with associated things. Signed-off-by: Maura Stephens --- acqui/cancelorder.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/acqui/cancelorder.pl b/acqui/cancelorder.pl index f64f906423..905c94ceb7 100755 --- a/acqui/cancelorder.pl +++ b/acqui/cancelorder.pl @@ -59,15 +59,16 @@ if($action and $action eq "confirmcancel") { my $reason = $input->param('reason'); my $error = DelOrder($biblionumber, $ordernumber, $del_biblio, $reason); + # Log the cancellation of the order + if (C4::Context->preference("AcqLog")) { + logaction('ACQUISITIONS', 'CANCEL_ORDER', $ordernumber); + } + if($error) { $template->param(error_delitem => 1) if $error->{'delitem'}; $template->param(error_delbiblio => 1) if $error->{'delbiblio'}; } else { $template->param(success_cancelorder => 1); - # Log the cancellation of the order - if (C4::Context->preference("AcqLog")) { - logaction('ACQUISITIONS', 'CANCEL_ORDER', $ordernumber); - } } $template->param(confirmcancel => 1); } -- 2.20.1