From a2e1d45c86b9511fce69a9f9563016a0a2aa86fa Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 5 Jul 2019 08:10:59 +0000 Subject: [PATCH] Bug 23057: (QA follow-up) Stay closer to old code Content-Type: text/plain; charset=utf-8 Somehow it feels safer to me to alert for a !$return directly after calling AddReturn. And restore the old code for alert_type at the end. Signed-off-by: Marcel de Rooy --- C4/SIP/ILS/Transaction/Checkin.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index f0e8bbdf49..047837d4b7 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -74,7 +74,13 @@ sub do_checkin { if ( $checked_in_ok ) { delete $messages->{NotIssued}; delete $messages->{LocalUse}; - $return = 1 unless keys %$messages; + if( keys %$messages ) { + $self->alert(!$return); + } else { + $return = 1; + } + } else { + $self->alert(!$return); } # biblionumber, biblioitemnumber, itemnumber @@ -130,11 +136,11 @@ sub do_checkin { } # ignoring messages: NotIssued, WasTransfered - if ($cv_triggers_alert) { - $self->alert( defined $self->alert_type ); # Overwrites existing alert value, should set to 0 if there is no alert type - } - else { - $self->alert( !$return || defined $self->alert_type ); + my $alert = defined $self->alert_type; + if ( $cv_triggers_alert ) { + $self->alert($alert); # Overwrites existing alert value, should set to 0 if there is no alert type + } else { + $self->alert($alert) if $alert; # Doesn't affect alert value unless an alert type is set } $self->ok($return); -- 2.11.0