Bug 1917 [QA Followup] - Don't limit the list results for RSS feeds
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 22 Apr 2015 11:36:51 +0000 (07:36 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 29 Apr 2015 15:09:25 +0000 (12:09 -0300)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/VirtualShelves/Page.pm

index 5a498cd..beed3e2 100644 (file)
@@ -78,10 +78,12 @@ sub shelfpage {
 
     $shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') );
     $shelflimit = $shelflimit || ShelvesMax('MGRPAGE');
+    $shelflimit = undef if $query->param('rss');
     $shelfoffset   = ( $itemoff - 1 ) * $shelflimit;     # Sets the offset to begin retrieving items at
     $shelveslimit  = $shelflimit;                        # Limits number of shelves returned for a given query (row_count)
     $shelvesoffset = ( $shelfoff - 1 ) * $shelflimit;    # Sets the offset to begin retrieving shelves at (offset)
-                                                # getting the Shelves list
+
+    # getting the Shelves list
     my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 );
     my $shelflist = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser );
     my $totshelves = C4::VirtualShelves::GetShelfCount( $loggedinuser, $category );
@@ -459,11 +461,13 @@ sub shelfpage {
         $qhash{$_} = $query->param($_) if $query->param($_);
     }
     ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash;
-    if ( $shelfnumber && $totitems ) {
-        $template->param(  pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" )  );
-    } elsif ( $totshelves ) {
-        $template->param(
-             pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" )  );
+    if ( $shelflimit ) {
+        if ( $shelfnumber && $totitems ) {
+            $template->param(  pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" )  );
+        } elsif ( $totshelves ) {
+            $template->param(
+                 pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" )  );
+        }
     }
     $template->param(
         shelveslooppriv                                                    => \@shelveslooppriv,