Bug 14487: silence warns during checkin
authorIndranil Das Gupta <indradg@gmail.com>
Fri, 3 Jul 2015 08:03:06 +0000 (13:33 +0530)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 28 Jul 2015 13:18:38 +0000 (10:18 -0300)
Test plan
=========

1/ check out an item and then check it back in.
1/ check the logs after the check-in to see the warns from
   returns.pl line 623 of :
    (a) Use of uninitialized value $holdingBranch
    (b) Use of uninitialized value $collectionBranch
2/ apply patch
3/ check out and check-in again. no warns are recorded this time.

NOTE: Under Debian Jessie, there are other messages.
      Additionally, this only corrects the line 623 ones.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
circ/returns.pl

index c36318f..91a6857 100755 (executable)
@@ -620,6 +620,8 @@ $template->param(
 $itemnumber = GetItemnumberFromBarcode( $query->param('barcode') );
 if ( $itemnumber ) {
    my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber );
+    $holdingBranch //= '';
+    $collectionBranch //= '';
     if ( ! ( $holdingBranch eq $collectionBranch ) ) {
         $template->param(
           collectionItemNeedsTransferred => 1,