From 14e2e4d5403eb280cefbbe9add61f0644bcf1ec3 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Fri, 20 Jun 2008 16:44:52 -0500 Subject: [PATCH] bugfix for bug introduced by anonymous session code Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index f7ae6d9c70..3426953221 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -145,13 +145,15 @@ sub get_template_and_user { $template->param( loggedinusername => $user ); $template->param( sessionID => $sessionID ); - my ($pubshelves, $barshelves); - if (($pubshelves, $barshelves) = C4::Context->get_shelves_userenv()) { - $template->param( barshelves => scalar (@$barshelves)); + my ($pubshelves, $barshelves) = C4::Context->get_shelves_userenv(); + if (defined($pubshelves)) { $template->param( pubshelves => scalar (@$pubshelves)); - $template->param( barshelvesloop => $barshelves); $template->param( pubshelvesloop => $pubshelves); } + if (defined($barshelves)) { + $template->param( barshelves => scalar (@$barshelves)); + $template->param( barshelvesloop => $barshelves); + } $borrowernumber = getborrowernumber($user); my ( $borr, $alternativeflags ) = @@ -239,8 +241,8 @@ sub get_template_and_user { $template->param( sessionID => $sessionID ); - my ($pubshelves); # an anonymous user has no 'barshelves'... - if (($pubshelves) = C4::Context->get_shelves_userenv()) { + my ($pubshelves) = C4::Context->get_shelves_userenv(); # an anonymous user has no 'barshelves'... + if (defined(($pubshelves))) { $template->param( pubshelves => scalar (@$pubshelves)); $template->param( pubshelvesloop => $pubshelves); } -- 2.39.5