From 3a3b6ba5d8fee454422cb8115b73d8adc585034f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 4 Oct 2010 11:11:11 -0400 Subject: [PATCH] Fix for Bug 5265, error message on lists is misleading The check to see if an item exists always evaluates as true. Correcting this lets the script handle the error as it was designed to. Signed-off-by: Nicole Engard Signed-off-by: Galen Charlton --- C4/VirtualShelves/Page.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 73ca42db8f..9d158472b7 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -89,7 +89,8 @@ sub shelfpage ($$$$$) { if ( $shelfnumber = $query->param('viewshelf') ) { if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) { if ( $barcode = $query->param('addbarcode') ) { - if ( $item = GetItem( 0, $barcode ) ) { + $item = GetItem( 0, $barcode ); + if (defined $item && $item->{'itemnumber'}){ $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'} ); AddToShelf( $biblio->{'biblionumber'}, $shelfnumber ) or push @paramsloop, { duplicatebiblio => $barcode }; -- 2.11.4.GIT