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);