From ad03c9e8f83ee60bd8c7d8df85cc07e0b2326556 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 --- 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.5