ResolvedPHP Warning: Attempt to read property “post_content”

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #37044
    egorp
    Participant

    PHP Warning: Attempt to read property “post_content”

    I have version 8.0.28 of PHP

    The log shows me the following error message constantly

    PHP Warning: Attempt to read property "post_content" on null in .../public_html/wp-content/themes/grosso/functions.php on line 1177

    The code line 1177 of the file is the following:

    <?php elseif(!has_shortcode($post->post_content, 'woocommerce_my_account')): ?>

    What can be wrong, how is it corrected?

    #37057
    Althemist
    Keymaster

    Hi egorp,

    Sounds like a third-party plugin conflict. The theme itself doesn’t throw such error.

    Also, the WP_DEBUG should be always disabled on a production site. This is just a warning, not a real error, so it would not be shown if the WP_DEBUG is disabled.

    #37074
    egorp
    Participant

    Thanks for the reply.

    Of course, the WP_DEBUG is disabled, the error was displayed by me as an administrator directly from the server log files.

    The error message is coming from one of the lines of code in the theme grosso fuctions.php file.

    I understand that that’s why I think it could help me to investigate what could be happening, as I indicated in the previous message, this happens in version 8 of PHP, in 7.4 it didn’t.

    #37078
    egorp
    Participant

    Any indication how i could solve it?, the error keeps appearing in the logs…

    PHP Warning: Attempt to read property “post_content” on null in …/public_html/wp-content/themes/grosso/functions.php on line 1177

    #37120
    Althemist
    Keymaster

    Hi egorp,

    Sorry for the late reply. Our lead developer Alex is investigating the problem. Will let you know asap.

    #37139
    Alex
    Keymaster

    Hi egorp,

    I’ve looked on it and couldn’t reproduce the warning. As Dimitar said, most probably the warning is caused by a third party plugin and it will not cause any harm, as it is just warning.
    We will add a check on that place and will include it the next update.

    Thanks,
    Alex

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in and have valid license to reply to this topic.

License required for any item belonging to this account
AlThemist

AlThemist

sales 18178, followers 756
Login and Registration Log in · Register