Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there,
after latest updates of core and many different modules I can see only 24 photos on "Manage items" page. And no pager.
Have you met such a behaviour?
Thanks,
Szy.
Comment | File | Size | Author |
---|---|---|---|
#22 | node_gallery-pager-2280221-22.patch | 745 bytes | stiknoltz |
Comments
Comment #1
szy CreditAttribution: szy commentedComment #2
jndpnt CreditAttribution: jndpnt commentedSame problem. I have a pager on the gallery, but not on the manage items page. Therefore I am only able to update the first 24 items and I can't access the others directly.
Comment #3
szy CreditAttribution: szy commented@jndpnt, I have searched for '24' somewhere in database, where I have found '24' as one of the variables. Or maybe hardcoded in the code of the module? I don't remember now - but it is somewhere there, look for it :)
Szy.
Comment #4
siltaar CreditAttribution: siltaar commentedDoes changing page size get the pager back ? I doubt it.
I have the same issue, I changed the page size in the associated view (to 750, the hardcoded max-image-in-gallery). I now can sort all my images at once. If I set back a smaller page size in the view, the pager will still miss.
In fact it seems to be lost at the embeding process of this view. I still have a pager in the Manage Items tab, will investigate.
Comment #5
pendaco CreditAttribution: pendaco commentedSame issue here, but no solution.
@szy
Where did you find this value, what is it called? (or what table is it in?)
@siltaar
I can only find a node_gallery_sort_images_max in node_gallery_api.pages.inc, with a default of 750. That variable however is not in my database, and looks to be related to the sort tab only.
"Enter the limit on the number of images displayed after upload." is at 100, but it only shows 24 items on the Sort tab.
For the manage items tab, my setting is at 20. It shows the pager, but still only shows 24 items max. With just 4 items on the 2nd page.
That pager within the single items seems to be messed up and is limited to 24 items (as on the Sort and Managed items tabs). While the gallery itself does show all thumbnails and pages.
Comment #6
szy CreditAttribution: szy commentedSorry, I don't remember. Count the number of items you have, and then just search for it in the code, in the database with phpMyAdmin, etc. Sooner or later you're gonna do it.
Szy.
Comment #7
pendaco CreditAttribution: pendaco commentedWell I got a gallery with 181 items.
That same number is in the table node_gallery_galleries as well, for the fields; item_count and pub_item_count (no 24 to be found).
The table node_gallery_relationship also lists all 181 items.
What I forgot to mention is the following php notice in the watchdog;
Notice: Undefined offset: 459 in node_gallery_api_get_item_position() (line 825 of /<snap>/modules/node_gallery/node_gallery_api.inc).
Where the 459 corresponds with the current node item viewed (node/459).
It only logs this notice when I open an item in the gallery above the first 24. Thrice in a row most likely for the previous/next, last links and counter.
Comment #8
Infinitee CreditAttribution: Infinitee commentedSame here... Only 24 listed in SORT ITEMS list (no pager) and error on node gallery item pages for gallery item nodes 25 and up.
I can add new images individually and with PLupload then edit caption and tags.
Except for publicly visible error, they display just fine in galleries and as nodes but, not in pager.
Notice: Undefined offset: 66 in node_gallery_api_get_item_position() (line 825 of J:\Aquia Dev Desktop 2\domains\drupal\sites\all\modules\node_gallery\node_gallery_api.inc).
Comment #9
Infinitee CreditAttribution: Infinitee commentedFor those who just want to hide the error message until a fix is found, add this to your CSS...
Comment #10
zengenuity CreditAttribution: zengenuity commentedI just installed a fresh copy of 7.x-1.x-dev and I'm not experiencing the problems described in this thread. I have a pager on Manage Items tab, and all items are shown on the sort items tab without a pager.
Also, DO NOT hide error messages as described in #9. All production sites should have error message display disabled under Configuration > Development > Logging and Errors.
Comment #11
Infinitee CreditAttribution: Infinitee commentedzengenuity...
Do you have more than 24 images in a gallery? If so, try deleting a couple in the middle and then adding a couple more to see if that replicates the problem. That is the only thing I know that I did that may cause an offset discrepancy.
Comment #12
zengenuity CreditAttribution: zengenuity commentedI had 74 images in the gallery when I tested earlier. I just tried deleting some and resorting some of them. Neither of those actions caused the symptoms described in this thread. I tried uploading some more images after deleting and sorting, and it didn't cause problems either.
Comment #13
pendaco CreditAttribution: pendaco commentedAnd what happens if you try it with version 1.0? ;)
If the dev is fixed that's great, than I'll just wait for 1.1.
Comment #14
Infinitee CreditAttribution: Infinitee commentedI installed 7.x-1.x-dev and still get same error.
Comment #15
szy CreditAttribution: szy commentedGuys, try to search for '24' in database via PHPMyAdmin. Use search, select all tabeles, all fields. You'll probably get lot of results, but focus on variable or system tables. Then the same with module's files. There is somewhere there - I have found this way.
Szy.
Comment #16
pendaco CreditAttribution: pendaco commented@ szy
The only '24' in code is;
$handler->display->display_options['pager']['options']['items_per_page'] = '24';
in node_gallery.views_default.inc Which sets the default pager amount for the 'Node Gallery: Gallery Item Views' view.
Instead of messing in the database, what I did was change the actual view;
- Go to the Node Gallery: Gallery Item Views view
- Set the pager on the Master display (or Image Sort display) to Display all items (instead of Paged output, full pager, 24 items)
- Save the changes made in the view
- Clear the cache
The Sort items tab now shows all 181 items on 1 page
The Manage items tab now shows 20 items per page and lists all pages/items
On the individual gallery items, the pager now shows all 181 items correctly
Although it seems to be fixed, I would still consider this somewhat of a work-around, or fluke..
Comment #17
Infinitee CreditAttribution: Infinitee commentedIt appears that setting the full pager to 20 and not 24 or, more will make the pager work correctly. Not my ideal setting but, at least it works.
It could have something to do with the embedded setting of 20 for the sort list???
Comment #18
RavindraSingh CreditAttribution: RavindraSingh commentedI have tried with 7.x-1.0 release, issue doesn't exist as I am doing module review process. So it was mandatory for me to test it out.
Comment #19
pendaco CreditAttribution: pendaco commentedHmm, not for me. If I set the pager to 20 I get the same results as with 24 (sort items only shows 20 items, and the gallery items show '1 of 20', with ' of 20' for the items above 20).
I'll keep the pager at 'display all items' for now.
Comment #20
Samfall CreditAttribution: Samfall commentedThis is still an issue for me also... Has anyone found a solution? I've been digging through code all day, and it seems to me that it's specifically related to an update from Views 3.7 to 3.8
It may be related to this: https://www.drupal.org/node/2276165
Comment #21
Samfall CreditAttribution: Samfall commentedThis is still an issue. Has no one found anything? I'm moving this to Active since it's still an issue, and many people have contributed information since the "needs more info" status was in place.
The pager is broken on both the Manage Items tab and the Sort Items tab. The number of items per page doesn't matter so much as the fact that the pager disappears if you want it. It's not reasonable on my site to show all items without a pager because of the load times for images and fields, particularly on the Manage Items tab (and I would assume the same is true for others).
I'd like to understand why it doesn't work so it can be fixed and not just avoided (with a work-around). Like I said in the previous comment, my intuition is that it's related to Views 3.7 -> 3.8 update.
Comment #22
stiknoltz CreditAttribution: stiknoltz commentedI believe the problem probably arose out of a fix to views that was covering up the bug in node_gallery.
It appears as though node_gallery uses one of the views it instantiates to count the total number of images in the gallery, however, the view it uses has a pager and is set to show to 24 images. Possibly views had a bug that prevented the pager from functioning when called from code, but if/when that was fixed, it exposed the bug in node_gallery.
The solution I came up with included in the patch is to force the view [as called by the node_gallery code which counts all images in a view] to skip using the pager so it gathers all nodes.
Hope this works for everyone.
Comment #23
stiknoltz CreditAttribution: stiknoltz commentedComment #24
s427 CreditAttribution: s427 commentedFYI I submitted a bug report that seems to be related to this issue, and after applying the above patch (#22), the problem seems to have been fixed! Thanks for that, that bug was a huge pain!
Comment #25
weikai CreditAttribution: weikai commentedThe number of limit is set in the views. Remove the item limit on "image sort" views (/admin/structure/views/view/node_gallery_gallery_item_views/edit/embed_5) should fix the problem.
Comment #26
Johan den Hollander CreditAttribution: Johan den Hollander commentedI can confirm that #22 fixes this problem. Applied this to two websites and after clearing the cache the pager works like it should.
Comment #27
ThomasKdot CreditAttribution: ThomasKdot as a volunteer commentedI can confirm that #25 fixed the issue for me. Glad to not having to mess around with patches or the database.
Comment #28
ThomasKdot CreditAttribution: ThomasKdot as a volunteer commentedI can confirm that #25 fixed the issue for me. Glad to not having to mess around with patches or the database.
Comment #29
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commentedI can confirm that the patch #22 works.
The view change suggested in #25 has a side effect in changing the number of images shown on the gallery page, so it is not a suitable fix for large galleries since it will cause slow page loads (and just too many images on the page anyway).
I can also confirm as per #24 that this patch fixes the other reported bug.
When testing this issue make sure you clear both the page cache as well as the views cache after making any change...
Comment #30
zengenuity CreditAttribution: zengenuity at DrupalTutor / Zengenuity commentedThe default view from a fresh install of -dev does not have this problem. The pager is removed from that particular display.