• Resolved TiKu

    (@tiku)


    Hi,

    Unfortunately version 3.1.2 still breaks NextGen Gallery. I activate wp-Typography plugin and start writing a new post. Now I click onto NextGen’s button to add a gallery. I choose a gallery as a source (the problem does not occur if I choose an album instead of a gallery). Now I want to exclude some images from the gallery. But unfortunately there’s just written “No entities to display for this source.”

    If I write the shortcode manually, the exclusions attribute is ignored:
    [nggallery images_per_page="4" number_of_columns="4" exclusions="1,2" id=253]

    As soon as I deactivate wp-Typography, things start to work.

    Regards
    TiKu

    https://www.ads-software.com/plugins/wp-typography/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author pepe

    (@pputzer)

    I can’t reproduce that problem with NextGen Gallery 2.1.23. What version are you using?

    However, NGG for me doesn’t work at all with the visual editor, so it looks like it’s doing some really crazy stuff. Have you tried to report this to Photocrati as well? Maybe they know what the conflict is. (The compatibility workaround just ensures that the content filter of wp-Typography runs after NGG – so I’m not sure why there appears to be interference on your install.)

    PS: Can I see screenshots of the output with and without wp-Typography somewhere?

    Thread Starter TiKu

    (@tiku)

    I’m using 2.1.23 as well. I noticed two things after starting this thread:

    1. After I deactivated and then reactivated wp-Typography once, NextGen’s popup window for inserting a new gallery into the post did work all of a sudden. The HTML code that it generates even works. But how can deactivation and reactivation of a plugin fix such things?
    2. The shortcode still does not work. The shortcode is displayed as is, with wp-Typography having the quotation marks replaced by typographic quotation marks – that’s why NextGen cannot process the shortcode anymore.

    So this seems to be a quite complex bug and I’m not sure how to reproduce it, given that the system healed itself. But it seems to me as if wp-Typography could need a better shortcode detection.

    Regards
    TiKu

    Thread Starter TiKu

    (@tiku)

    I’ll do screenshots if I manage to reproduce the problem again.
    As I did see the NGG shortcode having typographic quotation marks, I think that there exist situations in which your workaround is not triggered.

    Plugin Author pepe

    (@pputzer)

    • NGG appears to be doing some really funky things with shortcodes and filters (and sometimes triggers a fatal error due to some kind of recursion).
    • wp-Typography hasn’t got any kind of shortcode detection. The underlying engine is intended to be run on HTML code or pure text. The plugin normally uses the filter priority 9999, which is more than enough to run after any plugin except NGG. I’ve got no clue why, but NGG sets its filter priorities to PHP_INT_MAX - 1. That’s …. somewhat eccentric.
    • The workaround is looking for the existence of the class C_NextGEN_Bootstrap in the plugins_loaded hook. Is that sometimes not defined by NGG?
    Thread Starter TiKu

    (@tiku)

    You set the priority to PHP_INT_MAX, not PHP_INT_MAX - 1, but I guess this is supported by WordPress either way.

    I wonder whether it could be some kind of race condition. You use the plugins_loaded filter for your workaround. According to the docs this should be the perfect filter. But could it be that C_NextGEN_Bootstrap sometimes is not yet defined when this filter is triggered?

    I also noticed the recursion problem. As far as I know this recursion problem causes filters with a higher priority to not be executed anymore. But if this was the reason, wp-Typography probably wouldn’t be able to replace the quotation marks.

    I’ve written WordPress plugins myself, but currently I’m without clue what has caused this problem. I hope it has only been a hickup that won’t occur again.

    Regards
    TiKu

    Plugin Author pepe

    (@pputzer)

    Yes, I’m using PHP_INT_MAX to be sure to run after NGG. I’m not completely sure this is completely risk free, though. There might be weird implementation dependent stuff going on when such extremely high values are used as array indices etc.

    At the point of plugins_loaded, all plugins habe been loaded by WordPress, so the class should exist.

    As a workaround, if you add

    if (!defined('NGG_DISABLE_FILTER_THE_CONTENT')) define('NGG_DISABLE_FILTER_THE_CONTENT', TRUE);

    to your wp-config.php or as mu-plugin, the shortcode should work in any case.

    Plugin Author pepe

    (@pputzer)

    I’ve poked around module_third_party_compat.php some more. Maybe this version helps in your situation? It’s basically 3.1.3 with an additional early content filter that ensures that all NGG shortcodes are enabled. It doesn’t make any difference on my local installation, but maybe it helps with yours.

    Thread Starter TiKu

    (@tiku)

    Thanks a lot. I’ll try on sunday. I’m away for a couple of days.

    Thread Starter TiKu

    (@tiku)

    It’s difficult to test this version, since currently the problem does not occur anymore. I’ll save this version on my disk and test it if the problem occurs again.
    I’ve had a look at the code. It’s quite a hack and I hope there is no need to merge it into the public releases.

    Plugin Author pepe

    (@pputzer)

    Well, sort of. It’s what NGG does to be compatible with some third-party plugins (in /products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php). I’ll keep around the branch for the moment.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Still breaks NextGen Gallery Shortcodes’ is closed to new replies.