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:
- 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?
- 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.
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.