• Resolved Charles Fulton

    (@mackensen)


    We’ve just upgraded to NextGEN Gallery v2.0.63 from v2.0.61. We’re running WordPress 4.0.0. We have old-style imagebrowser galleries using the [imagebrowser id=”x”] shortcode. This gallery has existed since 2010. The site in question is a subdomain multisite using Day and name permalinks.

    The gallery in question is inserted into a page. Although the primary image displays the next and prev buttons do nothing. We’ve noticed that the link structure has changed between the two versions. Under 2.0.61 the links were formatted like this:

    http://your.subdomain/nggallery/image/your-image-slug-here/

    Under 2.0.63 they look like this:

    http://your.subdomain/your-page-here/nggallery/your-image-slug-here/

    Clicking the link has no apparent effect, although after clicking several times the link is rewritten into this bizarre string:

    http://your.subdomain/nggallery/pid–/pid–/pid–/pid–/image/

    Needless to say this doesn’t work. I didn’t see anything obvious in the changelog for this version to explain this issue. The issue is also present in 2.0.66.33, but first occurred in 2.0.63. There are no errors in the PHP log. We’re testing this on a development server which is not publicly accessible. I tried using the new-style shortcode ([ngg_images gallery_ids=”88″ display_type=”photocrati-nextgen_basic_imagebrowser”]) but this had no effect. We have AJAX turned on. Resetting options disables the AJAX but otherwise has no effect: the page loads with the incorrect URL (pid–/pid–) in the address bar.

    Any guide as to what changed and how we can get the old behavior back would be appreciated.

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @charles Fulton – I do not recall any issues with either legacy or current shortcode structures for the ImageBrowser display and I am not able to reproduce this issue.

    Perhaps real URL examples would shed some additional light on this issue you are seeing?

    – Cais.

    Thread Starter Charles Fulton

    (@mackensen)

    @photocrati this is an example which works under 2.0.61: http://reslife.lafayette.edu/residence-hall-housing/residence-hall-descriptions/. If we upgrade to 2.0.63 (or higher) it will stop working.

    Plugin Contributor photocrati

    (@photocrati)

    @charles Fulton – You appear to be using a non-default template for the ImageBrowser display but you did not specify that in your shortcode example.

    Perhaps there is something in your custom template that needs to be reviewed?

    – Cais.

    Thread Starter Charles Fulton

    (@mackensen)

    @photocrati Thanks for your quick reply. I’m not sure that I follow you. To the best of my knowledge we haven’t customized NGG nor are we using a custom template. I checked the settings for this site and the only thing specified under NextGEN Basic Image Browser is Enable AJAX Pagination. Where should I be looking? Are you saying there’s something in our theme which could be causing the issue?

    Plugin Contributor photocrati

    (@photocrati)

    @charles Fulton – The default ImageBrowser display does not show the image caption as it appears on your site.

    Since you are using shortcodes to insert these displays then have a look at this under Gallery > Gallery Settings … http://take.ms/CJqH1 (as taken from a default installation).

    – Cais.

    Thread Starter Charles Fulton

    (@mackensen)

    @photocrati sorry my late reply. That’s exactly what the setting looks like in my configuration; there’s no template specified (I don’t have the Display triggers options but I assume that’s part of the pro version). I’ve tried resetting the options and disabling and reenabling the plugin. It has no effect. On upgrading to 2.0.63 or higher the imagebrowser stops working.

    Plugin Contributor photocrati

    (@photocrati)

    @charles Fulton – Unfortunately there is not much I can offer in the way of troubleshooting as long as you are using an older version of NextGEN Gallery, but I also see you are using a “caption” style template which if you have not specifically set that would indicate something else has … or the plugin’s core code has been modified.

    IF the code was modified, then an update would remove those modifications. If the modifications were made to overcome a conflict, then once removed the conflict would also be returned to the site as well.

    – Cais.

    Thread Starter Charles Fulton

    (@mackensen)

    @photocrati the code is unaltered and I’ve just upgraded our development environment to 2.0.66.37 with no change. One thing I did notice, however, is that the images for used in the gallery have no value set in the image_slug column in the wp_x_ngg_pictures. I have no idea why that would be the case, possibly an upgrade went wrong at some point. Is this a potential problem and if so is it possible to regenerate the slugs?

    Plugin Contributor photocrati

    (@photocrati)

    @charles Fulton – The Reset Option under Gallery > Other Options is generally the best method to sort out missing/incorrect image slugs, followed by clearing the image cache under Gallery > Other Options > Miscellaneous.

    – Cais.

    Thread Starter Charles Fulton

    (@mackensen)

    @photocrati thanks, I’ve tried that, but the images in question still don’t have slugs. For each of these the image_slug field is empty with a length of 0.

    Plugin Contributor photocrati

    (@photocrati)

    @charles Fulton – Have you used any database “optimizer” plugins? In some rare cases, we have seen those actually corrupt the NextGEN Gallery tables … hopefully this is not the case as we may not be able to offer any assistance in correcting an issue like that.

    As it is, it may be best to send us a Bug Report (http://nextgen-gallery.com/report-bug/ … please reference this topic) so we can get a look under the page.

    We will need log in, FTP and most likely access to your database as well on your site … please include the appropriate credentials with your Bug Report.

    Thanks!

    – Cais.

    Thread Starter Charles Fulton

    (@mackensen)

    @photocrati We haven’t used any database optimization plugins or anything like that. We have a separate hosted MySQL database server. This is an enterprise environment and it is not possible to provide credentials.

    If you could provide guidance about the image_slug field I think that would be most helpful toward resolving the issue. It’s empty (not null, it’s simply empty with a length of zero) for about 20% of entries, and only from the oldest gallery. I suspect there may have been an issue with an upgrade 3-4 years ago. Can you point me to the part of the plugin which would have handled the creation of the slugs so that I might re-run it manually? In the alternative, can I simply create new slugs? I assume that the slugs must be unique within the wp_x_ngg_pictures table?

    Thread Starter Charles Fulton

    (@mackensen)

    I’ve made a wp-cli plugin which populates missing image slugs. The code is available on Github. @photocrati, I’d appreciate feedback on whether filling in the missing image_slug entries, without doing anything else, is a sound approach. Limited testing showed no issues, aside from needing to empty the gallery cache after running the script.

    Benjamin

    (@benjaminowens)

    I think your code is just fine. If I can make a recommendation, you are setting the slug to the result of sanitize_file_name($fileparts['filename'])) – NextGen uses the image alttext which can be the EXIF/IPTC name. If the image lacks metadata it is given to the image filename, so it may not be an issue for you.

    You can flush the gallery cache afterwards in code by calling C_Photocrati_Cache::flush('all');

    Thread Starter Charles Fulton

    (@mackensen)

    Benjamin, thank you for your very helpful suggestions. I really do appreciate it. I’ve incorporated both into the script, and rewritten it to be aware of which blog it’s in (although probably breaking single-site compatibility in the process).

    I’m satisfied at this point that our issue was caused by missing image slugs, which in turn was probably caused by a botched upgrade in the last 3-4 years. I think we’re all set here. Thanks again to you and @photocrati for your assistance.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘ImageBrowser next and prev buttons do nothing after update’ is closed to new replies.