Bug 467371 - RHN Satellite v5.1.0 - RHN List Page Size for Channel->Packages (and other perl pages) does not go beyond 50
RHN Satellite v5.1.0 - RHN List Page Size for Channel->Packages (and other pe...
Product: Spacewalk
Classification: Community
Component: Server (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Jan Pazdziora
Red Hat Satellite QA List
Depends On:
Blocks: space03
  Show dependency treegraph
Reported: 2008-10-17 03:36 EDT by Jan Pazdziora
Modified: 2009-09-17 03:02 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-17 03:02:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Pazdziora 2008-10-17 03:36:46 EDT
+++ This bug was initially created as a clone of Bug #467151 +++

Description of problem:
The number of items that can be displayed in the various "lists", i.e.; Systems page, Activation Keys page, etc. can be controlled globally by setting The RHN List Page Size located on "Your Preferences" page to the number you want, i.e. 500.  Setting the display to 500 does not set your default for the whole web site.  

How reproducible:
(1) On the Top Menu Bar click Your RHN
(2) Next Click "Your Preferences"
(3) Under RHN List Page Size table, in the display drop down list select "500".  This controls how many entries, like systems, would be displayed on the various list pages.
(5) Click Save Preferences
(6) Navigate to check the various lists.  Systems, Activation Keys, Systems Groups, Errata display the first 500.  The Channels -> Packages lists does not. 

Steps to Reproduce:
See above.

Actual results:
The default of 500 set in "Your Preferences" does not set your default for the whole web site.

The Channel -> Packages lists page does not show the first 500 packages, it shows only the first 50.
See attachment.

Expected results:
The default of 500 set in "Your Preferences" should set "all ""lists" for the whole web site. 

--- Additional comment from xdmoon@redhat.com on 2008-10-15 20:43:04 EDT ---

The bug resides in perl code in  /usr/lib/perl5/site_perl/5.8.5/RHN/DB/User.pm:
   my $size = $self->get_pref('page_size');
   $size = 20 unless $size;
   $size = 20 if not $size or $size < 5;
   $size = 50 if $size > 50;

Note that it shrinks the maximum page size to 50, presumably as a precaution. This is fine pre-Sat 5.1. as 50 used to be the maximum page size available to users, but in 5.1.0+ the maximum page size is determined by the constant com.redhat.rhn.frontend.taglibs.list.decorators.PageSizeDecorator.MAX_PER_PAGE which is 500.    

This bug is only manifested in pages like Channel -> packages because those pages are still in perl, and not yet ported to java.  Due to the above code, all perl pages with pagination will display no more than 50 items per page even if you specify more than that in user preferences.

Attached is a patch that fixes/work arounds it (a "service satellite-httpd restart" is needed after applying the patch).  Of course, it should really be a flexible number as opposed to a constant.

--- /usr/lib/perl5/site_perl/5.8.5/RHN/DB/User.pm.orig  2008-09-01 10:12:21.000000000 -0400
+++ /usr/lib/perl5/site_perl/5.8.5/RHN/DB/User.pm       2008-10-15 14:40:50.000000000 -0400
@@ -1988,7 +1988,7 @@
   my $size = $self->get_pref('page_size');
   $size = 20 unless $size;
   $size = 20 if not $size or $size < 5;
-  $size = 50 if $size > 50;
+  $size = 500 if $size > 500;

   return $size;

Comment 1 Jan Pazdziora 2008-10-17 03:39:28 EDT
Fix committed: 3a8a6d682f90a6b7599a965c9c208207e35c2103.
Comment 2 Jason Dobies 2008-11-04 11:39:08 EST
Note: Verified using SSM -> Packages -> Install since the Channels -> Packages is now a Java page.
Comment 3 Miroslav Suchý 2009-09-17 03:02:12 EDT
Spacewalk has been released for some time.

Note You need to log in before you can comment on or make changes to this bug.