Bug 5529 Absence or Presence of lists not being reliably returned
[koha.git] / C4 / VirtualShelves / Page.pm
index bbe89e8..df7054e 100644 (file)
@@ -393,18 +393,18 @@ sub shelfpage ($$$$$) {
 
     if ( defined $barshelves ) {
         $template->param(
-            barshelves     => scalar( @{ $barshelves->[0] } ),
-            barshelvesloop => $barshelves->[0],
+            barshelves     => scalar( @{ $barshelves } ),
+            barshelvesloop => $barshelves,
         );
-        $template->param( bartotal => $total->{'bartotal'}, ) if ( $total->{'bartotal'} > scalar( @{ $barshelves->[0] } ) );
+        $template->param( bartotal => $total->{'bartotal'}, ) if ( $total->{'bartotal'} > scalar( @{ $barshelves } ) );
     }
 
     if ( defined $pubshelves ) {
         $template->param(
-            pubshelves     => scalar( @{ $pubshelves->[0] } ),
-            pubshelvesloop => $pubshelves->[0],
+            pubshelves     => scalar( @{ $pubshelves } ),
+            pubshelvesloop => $pubshelves,
         );
-        $template->param( pubtotal => $total->{'pubtotal'}, ) if ( $total->{'pubtotal'} > scalar( @{ $pubshelves->[0] } ) );
+        $template->param( pubtotal => $total->{'pubtotal'}, ) if ( $total->{'pubtotal'} > scalar( @{ $pubshelves } ) );
     }
 
     output_html_with_http_headers $query, $cookie, $template->output;