• Hello,

    Thanks for creating and maintaining this plugin!

    I’m currently seeing an occasional entry in my error_log like this:

    [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

    (@mtekk)

    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

    (@antermoia)

    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.