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

    (@photocrati)

    @brockfanning – Where are you seeing this error message?

    – Cais.

    Thread Starter brockfanning

    (@brockfanning)

    Hi, sorry for not mentioning that. From what I can tell, the notice appears when I view any post that does not contain a gallery.

    Plugin Contributor photocrati

    (@photocrati)

    @brockfanning – Can you provide a link to this?

    I suspect there is something unique to your site that is setting this notice off as I am not able to recreate it anywhere on my test sites.

    Thanks!

    – Cais.

    Thread Starter brockfanning

    (@brockfanning)

    Thanks for looking into it. The site is still under development, but I may be able to get you a dev URL. Do you need to see the actual error? If so, I’ll need to turn on debugging in the config on that dev site:

    define(‘WP_DEBUG’, true);
    define(‘SCRIPT_DEBUG’, true);

    Thread Starter brockfanning

    (@brockfanning)

    I should also have mentioned PHP versions, due to the nature of the issue. I’m seeing this in PHP 5.5.3, and 5.4.4.

    Plugin Contributor photocrati

    (@photocrati)

    @brockfanning – The error message you noted above is fine for now, the page/post where it is displaying is or interest as well as which version of NextGEN Gallery you are using.

    Is this from 2.0.66, or our latest public beta version 2.0.66.12 as line 218 points to two different places in the code.

    – Cais.

    Thread Starter brockfanning

    (@brockfanning)

    Hi, I’m still trying to get permission to post a link. In the meantime, the version appears to be 2.0.66. Line 218 is:
    if ($post AND (strpos($post->content, "<!--nextpage-->") === FALSE) AND (strpos($_SERVER['REQUEST_URI'], '/page/') !== FALSE)) {

    Thanks for your help.

    Thread Starter brockfanning

    (@brockfanning)

    Hi again, a developer says she things it might be an interaction with another plugin, and she’s found a work-around for it. So, feel free to close this, sorry for the trouble.

    Plugin Contributor photocrati

    (@photocrati)

    @brockfanning – Thanks for the update … please feel free, as well, to share what the issue was specifically and the work-around just in case others may find it useful.

    – Cais.

    Hi there… I’m the person who picked up this Notice.

    I see the notice when running a custom template for the ‘Related Posts By Taxonomies’ module. It appears to be related to using setup_postdata($post) rather than the normal loop to populate the $post variable.

    What concerns me are two things:

    1) The code in your module where the notice occurs looks like this:

    function add_ngg_pro_page_parameter()
        {
            global $post;
    
            if ($post AND (strpos($post->content, "<!--nextpage-->") === FALSE) AND (strpos($_SERVER['REQUEST_URI'], '/page/') !== FALSE)) {
                if (preg_match("#/page/(\\d+)#", $_SERVER['REQUEST_URI'], $match)) {
                    $_REQUEST['page'] = $match[1];
                }
            }
        }

    But as I understand it, there is no $post->content to begin with… it’s $post->post_content.

    2) Why is this added to the “the_post” action? It appears to mangle the WP paging variable for any post, not just a gallery display.

    Plugin Contributor photocrati

    (@photocrati)

    @cath0de – It would seem we may need to review this “compatibility” code as it would have already been addressed elsewhere.

    In the meantime, I would suggest either removing (commenting out?) the following line:
    products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php:94

    … or adding a remove_action() call to the site so this method is not used. Something like this should work (not specifically tested as I have not been able to recreate the issue):

    remove_action( 'the_post', array( 'M_Third_Party_Compat', 'add_ngg_pro_page_parameter' ) );

    – Cais.

    Thank you. I had fixed it by changing $post->content to $post->post_content, but removing the action is also a good idea. I’ll give that a try.

    Plugin Contributor photocrati

    (@photocrati)

    @cath0de – The remove_action call is also more update safe in most cases.

    Thanks!

    – Cais.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘PHP notice in module.third_party_compat.php’ is closed to new replies.