From 5a5abf655776440d3470f1c75b08e1bc993110e9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 May 2016 19:57:16 +0100 Subject: [PATCH] Bug 16570: Do not tell all checked-in items are part of a rotating collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When an item is checked-in a message will tell you it's part of a rotating collection, even if it's not true. Test plan: Make sure the message appears only when needed. Signed-off-by: Marc VĂ©ron Signed-off-by: Nick Clemens --- circ/returns.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 3804543..c91d784 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -642,16 +642,18 @@ $template->param( $itemnumber = GetItemnumberFromBarcode( $barcode ); if ( $itemnumber ) { - my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber ); - $holdingBranch //= ''; - $collectionBranch //= $returnbranch; - if ( ! ( $holdingBranch eq $collectionBranch ) ) { - $template->param( - collectionItemNeedsTransferred => 1, - collectionBranchName => GetBranchName($collectionBranch), - collectionBranch => $collectionBranch, - itemnumber => $itemnumber, - ); + my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber ); + if ( $holdingBranch and $collectionBranch ) { + $holdingBranch //= ''; + $collectionBranch //= $returnbranch; + if ( ! ( $holdingBranch eq $collectionBranch ) ) { + $template->param( + collectionItemNeedsTransferred => 1, + collectionBranchName => GetBranchName($collectionBranch), + collectionBranch => $collectionBranch, + itemnumber => $itemnumber, + ); + } } } -- 2.1.4