From 9998cc279c09c66c320b318b8153f001053eef5c 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 --- circ/returns.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 49899f0..676b5ef 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -640,16 +640,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, + ); + } } } -- 1.7.10.4