- #FIXME: This refresh really only needs to happen when there is a modification of some sort
- # to the shelves, but the above code is so convoluted in its handling of the various
- # options, it is easier to do this refresh every time C4::VirtualShelves::Page.pm is
- # called
-
- my ( $total, $pubshelves, $barshelves ) = RefreshShelvesSummary( $query->cookie("CGISESSID"), $loggedinuser, ( $loggedinuser == -1 ? 20 : 10 ) );
-
- if ( defined $barshelves ) {
- $template->param(
- barshelves => scalar( @{ $barshelves } ),
+#Next call updates the shelves for the Lists button.
+#May not always be needed (when nothing changed), but doesn't take much.
+ my ($total, $pubshelves, $barshelves) = C4::VirtualShelves::GetSomeShelfNames($loggedinuser, 'MASTHEAD');
+ $template->param(
+ barshelves => $total->{bartotal},