• I am writing to report two critical issues that appeared immediately after updating the plugin from version 3.59.12 to version 4.2.3. Both issues only affect the new default ImageBrowser template, while Legacy templates work correctly.

    The Issue in the Code:

    At the end of default-view.php, I found this:

    </div> </div> </div> <?php $this->end_element(); ?>

    There are three closing </div> tags, but only one is needed to close the .ngg-imagebrowser container.

    Correct structure should be:

    </div> <?php $this->end_element(); ?>

Viewing 1 replies (of 1 total)
  • Plugin Support Mihai

    (@mceban)

    Hi @ulenka1984 ,

    Thank you for reading through the template source and sending such a detailed report.

    You’re right, and I want to confirm that plainly: this is a bug in our plugin. I’ve passed your finding to our development team.

    The default Image Browser template ends with three closing “</div>” tags, and only one of them belongs there. The template opens six “<div>” elements, and five of those are already closed earlier in the file. By the time you reach the end, only the outer gallery container is still open, so a single closing tag is all it needs.

    The two spare tags don’t sit there harmlessly. They close whichever containers your theme has wrapped around the gallery. That is why post content after a gallery can slide out of position or wrap into the navigation buttons.

    Your proposed fix is the correct one. I’ve added it to our existing report about the ImageBrowser, so the markup problem and the navigation problem are now tracked in the same place.

    If you need a clean page before the fix ships

    You can override the template so your correction survives plugin updates. Create this file on your site:

    wp-content/ngg/modules/photocrati-nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php

    Copy the full contents of nextgen-gallery/templates/ImageBrowser/default-view.php into it. Then remove the two spare closing tags at the end, so the last two lines read:

        </div>

    <?php $this->end_element(); ?>

    NextGEN Gallery looks in that folder before it uses its own copy, and nothing in that folder is touched when the plugin updates. One caveat: because it is a full copy, you would need to bring over any later changes we make to that template by hand. Once our fix is released you can delete the override and go back to the shipped version.

    Thanks again for the detail here.

    Best,
    Mihai

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.