NextGEN Gallery
Compatibility issues with other plugins (FCB) (32 posts)

  1. ViperBe
    Posted 5 years ago #

    I am having compatibility issues between NGG and other WP plugins: "SFC - Like" and "SFC - Share" which are part of the Simple Facebook Connect plugin. Whenever I activate either of these SFC plugins the NGG fails to display galleries.

    Without the SFC plugins activated, the HTML code is as follows:

    <!-- main START -->
    		<div id="main">
    	<div class="post">
    		<h3 class="title">Photos</h3>
    		<div class="content">
    			<p>Gallery Desc</p>  <div class="ngg-galleryoverview" id="ngg-gallery-5-86">
    	<!-- Slideshow link -->

    But once I activate either plugin, the NGG plugin fails to generate the gallery:

    <!-- main START -->
    		<div id="main">
    	<div class="post">
    		<h3 class="title">Photos</h3>
    		<div class="content">
    			<p>Gallery Desc</p>			<div class="fixed"></div>
    		<div class="meta">

    As you can see, the entire DIV which should contain the images is omitted.
    I have found a topic in SFC support which is almost identical to my issue and several months old. I have also contacted the SFC dev, however he says this is an issue with NGG.

    Any help would be greatly appreciated..

  2. Alex Rabe
    Posted 5 years ago #

    why should this a error of NGG, can you please post a reason for that ?

  3. ViperBe
    Posted 5 years ago #

    I don't know.. that is what I was told by the FCB developer when I asked him about this issue. I am trying to use both plugins, I don't know much about their workings, or WP internals for that matter. If I knew why it wasn't working or what was causing it I'm sure I would be so much closer to actually finding a fix...

    edit: I should note that if I modify the SFC plugin to skip the apply_filters() call, NGG shows the gallery properly.. however as stated in that topic, doing that breaks FCB.

  4. Alex Rabe
    Posted 5 years ago #

    Maybe he can give us a hint what could be the fault of NGG, I will then fix it

  5. The error with NGG is two fold.

    First, NGG needs to allow whatever it is hooking to the_content filter to be run more than once on the page. SFC applies the content filter to the content in order to allow it to process shortcodes and things of that nature, so it can see the final and completed content of the post. It needs to do this to get images and other stuff of that nature.

    Secondly, NGG needs to also load the shortcode handling code on the back-end of the site. The publish plugin tries to process the shortcodes as well, so that it can do much the same thing.

    Basically, NGG is trying to be far too smart. If some other plugin needs the content of a post to do something, then it's going to use a the_content call, or a get_the_content call followed by apply_filters of the_content. Any plugin that uses the content filters to modify the post content should allow this to work a) at all times and b) more than once per post.

  6. Alex Rabe
    Posted 5 years ago #


    since 1.6.X I'm loading all shortcode & other lib's always ( http://code.google.com/p/nextgen-gallery/source/detail?r=750 ). The "smart" idea was to reduce the memory footprint, but I didn't remind that other plugin do there stuff in the back end.

    About the_content filter : I'm using add_shortcode(), the filter is just used one time (to convert old shortcodes), so I'm not sure what is wrong with my code at this point and what I should change...

  7. I haven't used or looked at the code for NGG, so I can't tell you what is specifically wrong, but there is a possible way to debug.

    Take a theme. Make it call the_content() twice in a row. Does the gallery display twice on the page? If not, why not?

  8. briarddixie
    Posted 5 years ago #

    Had the same issue:
    calling the_content twice breaks the NGG navigation of [album] etc.

    If i have an album, containing some galleries, containing the images,
    the top-level view of the album is showing good. But if the reader navigates a level down to a gallery rendering gets confused:
    Tracing NGG's filter output shows, that on the first call NGG delivers correct output, on the second call, NGG somehow thinks, the user navigated to another depth or whatever of the nested almbum/gallery.

    My workaround was to patch SFC not calling the_content in the page header, thus not be able to correctly find a thumbnail for a NGG page.

    imo, It is NOT the abovementioned shortcode filter of NGG, it has something to do with the state of album/gallery navigation.

    The scenario is described here: http://wordpress.org/support/topic/plugin-nextgen-gallery-album-tag-renders-empty-when-the_content-filter-is-applied-twice?replies=1#post-1821654

  9. Alex Rabe
    Posted 5 years ago #

    I'm using add_shortcode which replace the placeholder with the gallery content. You can call the_content(); as often you want, it will always show the gallery as as long as the function add_shortcode() will be executed. Same for the WordPress core gallery shortcode...

  10. @Alex: Yes, except that for some reason, it doesn't.

    It's not a matter of your add_shortcode or even your filter on the_content, it's a matter of how those functions actually behave and what they do. Like briarddixie pointed out above, it doesn't behave the same on subsequent calls to the gallery display code.

    A shortcode function or a filter should return the same thing every time, given the same content/input. Somehow, it's maintaining some kind of other state so that continued calls don't return the same thing.

  11. Alex Rabe
    Posted 5 years ago #

    Please let us go back to the main issues you reported :

    a) you can call the_content more than one time, It will show a gallery
    b) the shortcode handling code will now be loaded in the backend ( since 1.6.0)

    briarddixie reported something complete different, the handling of album links when the_content is called more times, as I used here a special permalink structure I need to look into it, but it will not prevent the showing of a gallery.

  12. Okay, so what exactly is the problem then? Why is it *not* showing the gallery when my plugin applies the_content filter?

    In the head, I do this:

    $content = get_the_content();
    $content = apply_filters('the_content', $content);

    The first line gets the post early and populate the $post variables and such.

    The second line rewinds the query, so that the main Loop will have the ability to get the post properly.

    The third line gets the content, unprocessed.

    The fourth line applies the_content filter to it, which processes shortcodes and everything else. This is done so that I can get the complete content of the post, as it will be displayed.

    When you do that, NGG fails to display the gallery in the main post body. If you comment out the final line, then NGG displays the gallery.

    Why is NGG not displaying the gallery? That's the question.

  13. Alex Rabe
    Posted 5 years ago #

    How can I reproduce this behavior ?

    Setup SFC Like & Share button (Setting : Before AND After the content of your post). My gallery still appear.

  14. Alex: Like I said, I don't use NGG. I'm just reporting what several of my users have told me.

  15. ViperBe
    Posted 5 years ago #

    I had NGG setup already.
    When I installed FCB and activated the "SFC - Like Button" plugin, galleries stopped working. They still show, but when clicking on one to open, they fail and load an empty page (showing post context, but not the gallery itself). I have it set to manual, but it's the same behaviour as when using "before and after the content of your post".

    If you need any more info regarding my setup I will try to provide it..

  16. Alex Rabe
    Posted 5 years ago #

    @ViperBe Which shortcode do you use ? Are you use a album or gallery shortcode ?

  17. iSheik
    Posted 5 years ago #

    same problem here. I'm using:

    [album id=2 template=compact]

    on activated "SFC - Like Button" the Albums are displayed but if i click on a gallery it will display an empty page.

  18. ViperBe
    Posted 5 years ago #

    Same here.. I use [album=2,compact]. Albums and sub-albums show, but where galleries are supposed to be, it s left empty.

    I had not noticed this before though, but I have checked now and the gallery shortcode ([nggallery id=25 images=8]) does work fine.
    It is only when galleries are approached through an album that they fail to display..

  19. Alex Rabe
    Posted 5 years ago #

    OK, now I can work on this... I will come back when I have a fix for this

  20. Alex Rabe
    Posted 5 years ago #

    Ok, I'm able to track down "my main fault" : A Album show just one instance in the case use use more than one shortcode in a post . As Otto mentioned his plugin call already the content filter in the head. So my internal function "think" the shortcode is used twice or more... You can disable the check in the follow file :


    line 417 : $GLOBALS['nggShowGallery'] = true;
    line 427 : $GLOBALS['subalbum'] = true;

    Just delete or comment out these two lines and it should show up. This work's fine as long as you are not using two album shortcode in one post, the you will receive the content twice. So I need to look here for a better solution.

  21. mseigafuse
    Posted 5 years ago #

    My gallery does now show, but it does show twice. Thanks for working on this, hope you find the better solution.


  22. Alex Rabe
    Posted 5 years ago #

    thanks for your feedback, I will add a note to the plugin description that it's imcompatible with Simple Facebook Connect. There are other plugins you can use, so it's not top urgent and I will rework my function

  23. ViperBe
    Posted 5 years ago #

    Those 2 edits fix the issue for me. Since I don't have any places where I use multiple gallery shortcodes in a single post yet, I don't have the issue where it shows twice.

    Thanks for the patch. Looking forward to a more permanent solution!

  24. musicattiva
    Posted 5 years ago #

    the problem is not solved for me.
    I have pages with multiple galleries, organized in albums.

    from what I understand the fix for nextgen, only solve if you do NOT use album and, for me, this is a great limitation.
    Albums are a great feature which is a shame to limit it, also because there is no other way to represent various galleries.

    This is an example of my page:
    Activating SFC - Like Button Version 0.25, the galleries are a blank page

    Nextgen Version 1.7.4
    SFC - Like Button Version 12:25

    Take this opportunity to say that would be a good idea if the NextGen Gallery Slideshow, without title, it does not put a default and recover the space. This is to allow its use in different contexts from classical widgets.

  25. pelw
    Posted 5 years ago #

    Hi, I just took over a site.
    Its running wpmu 3.0.1 and the Nextgen plugin is 1.7.3

    One of the former admins installed simple facebook connect and the Nextgen gallery stopped working. Any way, before my jobb started I told them to uninstall the SFC plugin but the slideshow carousel is still not working.
    Please take a look http://www.aveny.se/?vimmel=yaki-da-29

    What to do?

  26. ViperBe
    Posted 5 years ago #

    Is there any chance of a more permanent solution for this being implemented...
    The workaround works, but I have to remember to edit the source code after every update.. I also keep running into the "multiple album short codes in 1 post" issue caused by the workaround, so a more permanent fix for this would be nice..

  27. danmarce
    Posted 4 years ago #

    Ok, I did edit the lines (430 and 440 in the 1.8.3 version). I installed this a while ago and was not aware of the bug.

    The good news are that there is a solution, the bad news are that I actually will have to update the lines in every update.

    Of all Facebook plugins I tested SFC is the best one, for functionality and design. And for Galleries I do like this one (updating all my current galleries would be a enormous task to do).

  28. Sportivo
    Posted 4 years ago #

    Editing the lines did the job for me as well.

  29. keith.sykes@telecomsense.co.uk
    Posted 4 years ago #

    Hi Alex and Otto,
    Would it be possible for you guys to work together to ressolve this issue.

    I have a page with the short code

    [album id=5 template=compact]

    [album id=6 template=compact]

    [album id=1 template=compact]

    this level displays ok but when drilling down I get a blank screen with SFC enabled, if I delete the lines as suggested I get multiple albums,

    I currently have to enable SFC every time I need to publish to facebook, this soluiton is not suitible for the rest of the website editior. As you both have a high profile plugin it would be GREAT if if didn't clash.

    Yours hopedfully

  30. Mike McKoy
    Posted 4 years ago #

    The reason for Nextgen's incompatibility was discovered 8 months ago and Alex has bee made aware. It's related to this post: http://wordpress.org/support/topic/plugin-nextgen-gallery-ngg-and-featured-image-issue?replies=17

    The issue is that nextgen modifies the thumbnail ID from wordpress standards and saves the ID as a non-integer when WP expects ID to be saved as an integer.

    That would make Nextgen incompatible with a lot of different plugins. Alex has said he will look into fixing this but i'm unsure if he's even started. It would be nice to see in the next release...that would benefit a lot of users and make Nextgen a enterprise level product.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NextGEN Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic