Gallery icon indicating copy to clipboard operation
Gallery copied to clipboard

System setting "default_per_page" breaks Gallery pagination in manager

Open labr1005 opened this issue 13 years ago • 2 comments

I changed the system setting "default_per_page" to 50.

I have an album that has 40 pictures.

The album pagination says "Page 1 of 1", "Per Page: 50", "Displaying 1 - 20 of 40".

Only the first 20 images are shown and the "First/Previous/Next/Last"-Buttons are disabled. I have to hit the "Refresh"-Button first in order to see all images...

  • MODX Revolution 2.2.4-pl (traditional)
  • Gallery 1.5.2-pl

labr1005 avatar Jul 23 '12 08:07 labr1005

Same problem here

×MODX Revolution 2.2.4-pl (traditional) ×Gallery 1.5.2-pl

I have this problem since Gallery 1.5.0-pl

migueldlarosa avatar Aug 27 '12 22:08 migueldlarosa

To fix this you need to add "limit" param to the GAL.view.AlbumItems configuration: file: /assets/components/gallery/js/mgr/widgets/album/album.items.view.js

I marked the added line with plus sign below:

GAL.view.AlbumItems = function(config) {
    config = config || {};

    this._initTemplates();
    Ext.applyIf(config,{
        url: GAL.config.connector_url
        ,fields: ['id','album','name','description','mediatype','url','createdon','createdby','filename','filesize','thumbnail','image','image_width','image_height','tags','active','rank','absoluteImage','relativeImage','menu']
        ,ident: 'galbit'
        ,id: 'gal-album-items-view'
        ,baseParams: {
            action: 'mgr/item/getList'
            ,album: config.album
+          ,limit: config.pageSize || (parseInt(MODx.config.default_per_page) || 20)
        }

ivarspede avatar Feb 24 '13 13:02 ivarspede