Bug 14487: Noise best detected under Debian 8

The first error is caused by the fact that
$messages->{'IsPermanent'} is undefined.

The second error is caused by querying the CGI
parameter 'barcode' inside a function call. This is not required.
There is a variable $barcode set with the parameter. Changed to
use the variable.

TEST PLAN
----------
1) Test first patch.
2) Clear the log
3) Put in a barcode which is not checked out.
4) Check the log.
   -- should be two errors. One about a hash,
      the other will only be detectable under Debian 8.
5) Apply this second patch
6) Clear the log
7) Put in a barcode which is not checked out.
8) Check the log.
   -- should be empty.
9) run koha qa test tools

Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.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>
(cherry picked from commit beef853472)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
This commit is contained in:
Mark Tompsett 2015-07-03 18:04:04 -04:00 committed by Liz Rea
parent 3494e97834
commit e298d5c83d
1 changed files with 3 additions and 2 deletions

View File

@ -462,7 +462,8 @@ foreach my $code ( keys %$messages ) {
}
elsif ( $code eq 'NotIssued' ) {
$err{notissued} = 1;
$err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'};
$err{msg} = '';
$err{msg} = $branches->{ $messages->{'IsPermanent'} }->{'branchname'} if $messages->{'IsPermanent'};
}
elsif ( $code eq 'LocalUse' ) {
$err{localuse} = 1;
@ -613,7 +614,7 @@ $template->param(
BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"),
);
$itemnumber = GetItemnumberFromBarcode( $query->param('barcode') );
$itemnumber = GetItemnumberFromBarcode( $barcode );
if ( $itemnumber ) {
my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber );
$holdingBranch //= '';