kohabug 1875 Public lists/virtualshelves are displayed and viewable whether a patron...
[koha.git] / opac / opac-shelves.pl
index b26f73a..61bf9e3 100755 (executable)
@@ -31,4 +31,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
         type            => "opac",
         authnotrequired => 1,
     });
-shelfpage('opac', $query, $template, $loggedinuser, $cookie);
+
+# if $loggedinuser is not defined, set it to -1, which should
+# not correspond to any real borrowernumber.  
+# FIXME: this is a hack to temporarily avoid changing several
+#        routines in C4::VirtualShelves and C4::VirtualShelves::page
+#        to deal with lists accessed during an anonymous OPAC session
+shelfpage('opac', $query, $template, (defined($loggedinuser) ? $loggedinuser : -1), $cookie);