Title: PHP notice in module.third_party_compat.php
Last modified: August 21, 2016

---

# PHP notice in module.third_party_compat.php

 *  Resolved [brockfanning](https://wordpress.org/support/users/brockfanning/)
 * (@brockfanning)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/)
 * Hello, we are using the free version, and are seeing this PHP notice:
 * Notice: Undefined property: stdClass::$content in …\wp-content\plugins\nextgen-
   gallery\products\photocrati_nextgen\modules\third_party_compat\module.third_party_compat.
   php on line 218
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124416)
 * [@brockfanning](https://wordpress.org/support/users/brockfanning/) – Where are
   you seeing this error message?
 * – Cais.
 *  Thread Starter [brockfanning](https://wordpress.org/support/users/brockfanning/)
 * (@brockfanning)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124426)
 * 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](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124441)
 * [@brockfanning](https://wordpress.org/support/users/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](https://wordpress.org/support/users/brockfanning/)
 * (@brockfanning)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124445)
 * 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](https://wordpress.org/support/users/brockfanning/)
 * (@brockfanning)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124446)
 * 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](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124543)
 * [@brockfanning](https://wordpress.org/support/users/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](https://wordpress.org/support/users/brockfanning/)
 * (@brockfanning)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124609)
 * 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](https://wordpress.org/support/users/brockfanning/)
 * (@brockfanning)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124610)
 * 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](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124614)
 * [@brockfanning](https://wordpress.org/support/users/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.
 *  [cath0de](https://wordpress.org/support/users/cath0de/)
 * (@cath0de)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124617)
 * 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](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124619)
 * [@cath0de](https://wordpress.org/support/users/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.
 *  [cath0de](https://wordpress.org/support/users/cath0de/)
 * (@cath0de)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124620)
 * 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](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124621)
 * [@cath0de](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/php-notice-in-modulethird_party_compatphp/#post-5124621)
 * Status: resolved