Title: PHP Warning in error_log
Last modified: February 13, 2024

---

# PHP Warning in error_log

 *  [Alexander S. Kunz](https://wordpress.org/support/users/antermoia/)
 * (@antermoia)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-in-error_log-2/)
 * Hello,
 * Thanks for creating and maintaining this plugin!
 * I’m currently seeing an occasional entry in my error_log like this:
 *     ```wp-block-code
       [13-Feb-2024 13:23:27 UTC] PHP Warning:  Attempt to read property "post_type" on null in /home/xxx/public_html/alexkunz/wp-content/plugins/breadcrumb-navxt/class.bcn_breadcrumb_trail.php on line 397
       ```
   
 * I’m using the latest WordPress, PHP 8.1, and the latest version of the plugin.
 * Is there something I can do to troubleshoot this?
 * Thanks
 * Alex.

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

 *  Plugin Author [John Havlik](https://wordpress.org/support/users/mtekk/)
 * (@mtekk)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-in-error_log-2/#post-17423417)
 * Getting that warning is odd. For that to happen the ID passed in to the function
   was not for a post (so `get_post()` returned null). The only call within the 
   plugin checks if the ID passed in is from an instance of WP_Post, so, either 
   there is something else that made the call to the `post_hierarchy()` function,
   or something is quite broken. Eventually, that function is going to change (next
   major release, i.e. 8.0), in the meantime I can look at adding a check before
   the line of code throwing the warning.
 *  Thread Starter [Alexander S. Kunz](https://wordpress.org/support/users/antermoia/)
 * (@antermoia)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-in-error_log-2/#post-17423440)
 * Thanks for the prompt response, John.
 * I’m sorry that I don’t understand all of your reply (I’m more on the “he’s a 
   user” end of the spectrum…) — I’ve only been paying attention to my error_log
   after I switched to PHP 8.1 and stumbled upon these repeating entries.
 * I know it’s way outside of the scope of what you can offer but if you have any
   hint what I should look for trying to identify a “quite broken” something, I’d
   be very grateful. (a Google search returns hundreds and hundreds of entries for
   this “Attempt to read property “post_type” on null” warning.)
 * Thanks
 * Alex.

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

The topic ‘PHP Warning in error_log’ is closed to new replies.

 * ![](https://ps.w.org/breadcrumb-navxt/assets/icon.svg?rev=1927103)
 * [Breadcrumb NavXT](https://wordpress.org/plugins/breadcrumb-navxt/)
 * [Support Threads](https://wordpress.org/support/plugin/breadcrumb-navxt/)
 * [Active Topics](https://wordpress.org/support/plugin/breadcrumb-navxt/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/breadcrumb-navxt/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/breadcrumb-navxt/reviews/)

## Tags

 * [error_log](https://wordpress.org/support/topic-tag/error_log/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 2 replies
 * 2 participants
 * Last reply from: [Alexander S. Kunz](https://wordpress.org/support/users/antermoia/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/php-warning-in-error_log-2/#post-17423440)
 * Status: not resolved