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.

CommentFileSizeAuthor
#22 node_gallery-pager-2280221-22.patch745 bytesstiknoltz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

szy’s picture

Component: Code » User interface
jndpnt’s picture

Same 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.

szy’s picture

@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.

siltaar’s picture

Does 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.

pendaco’s picture

Same 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.

szy’s picture

Sorry, 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.

pendaco’s picture

Well 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.

Infinitee’s picture

Same 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).

Infinitee’s picture

For those who just want to hide the error message until a fix is found, add this to your CSS...

/* Hide error messages on gallery pages */
.node-type-node-gallery-item .messages.error {
    display: none;
}
zengenuity’s picture

Status: Active » Postponed (maintainer needs more info)

I 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.

Infinitee’s picture

zengenuity...

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.

zengenuity’s picture

I 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.

pendaco’s picture

And 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.

Infinitee’s picture

I installed 7.x-1.x-dev and still get same error.

szy’s picture

Guys, 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.

pendaco’s picture

@ 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..

Infinitee’s picture

It 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???

RavindraSingh’s picture

I 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.

pendaco’s picture

It 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???

Hmm, 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.

Samfall’s picture

This 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

Samfall’s picture

Status: Postponed (maintainer needs more info) » Active

This 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.

stiknoltz’s picture

I 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.

stiknoltz’s picture

Status: Active » Needs review
s427’s picture

FYI 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!

weikai’s picture

The 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.

Johan den Hollander’s picture

I can confirm that #22 fixes this problem. Applied this to two websites and after clearing the cache the pager works like it should.

ThomasKdot’s picture

I can confirm that #25 fixed the issue for me. Glad to not having to mess around with patches or the database.

ThomasKdot’s picture

I can confirm that #25 fixed the issue for me. Glad to not having to mess around with patches or the database.

Anonymous’s picture

I 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...

zengenuity’s picture

Status: Needs review » Closed (cannot reproduce)

The default view from a fresh install of -dev does not have this problem. The pager is removed from that particular display.