From ab27da89a9707558f40c3ea38e66da7043f6da80 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 6 Dec 2011 16:03:31 -0500 Subject: [PATCH] Bug 7325 - Editing a list generates errors in the log Checking for variables before trying to use them in building the pagination menu Signed-off-by: Chris Cormack Signed-off-by: Paul Poulain (cherry picked from commit 17df078261b9054b45f87c42f34d9a9e82fba138) Signed-off-by: Chris Nighswonger --- C4/VirtualShelves/Page.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 18535a5724..523527e167 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -367,9 +367,9 @@ sub shelfpage ($$$$$) { $qhash{$_} = $query->param($_) if $query->param($_); } ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash; - if ( $shelfnumber ) { + if ( $shelfnumber && $totitems ) { $template->param( pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" ) ); - } else { + } elsif ( $totshelves ) { $template->param( pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" ) ); } -- 2.39.5