From 30fac5c75a2f901f6b93266bf8836489c1fcbc84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Mon, 7 Jun 2021 17:07:04 +0300 Subject: [PATCH] Bug 27064: (QA follow-up) Add error message only if we have one defined MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This moves the DestinationEqualsHolding error message addition to if clause so the value is added to %err hash only when there is actually an error. Then we only append to the @errmsgloop array the error message if one was defined. To test: 1) Create a hold request to a pickup library where the item currently is not 2) Add transfer to the pickup library using branchtransfers.pl and notice without this patch we get and empty message box but with this patch we don't get it. Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- circ/branchtransfers.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index bb508f77a0..ca14276e09 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -213,8 +213,10 @@ foreach my $code ( keys %$messages ) { $err{patron} = $patron; } } - $err{errdesteqholding} = ( $code eq 'DestinationEqualsHolding' ); - push( @errmsgloop, \%err ); + elsif ( $code eq 'DestinationEqualsHolding' ) { + $err{errdesteqholding} = 1; + } + push( @errmsgloop, \%err ) if (keys %err); } } -- 2.39.2