• Marty

    (@bozzmedia)


    Recently seeing this in my debug log. PHP 8.0, WP 6.0.3

    PHP Warning: Attempt to read property “ID” on null in /home/redacted/public_html/production/wp-content/plugins/fresh-forms-for-gravity/class-fresh-forms-for-gravity.php on line 296

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Samuel Aguilera

    (@samuelaguilera)

    Hi @bozzmedia

    I’m unable to replicate the warning in a default WordPress installation running over PHP 8.0 and the latest WP 6.1.1.

    It’s something easy to fix anyway, but I would like to know a bit more about the case before deploying a fix.

    Can you please provide further details? Like which caching solution are you using and which part of your site are you loading when that warning is added to your log?

    Plugin Author Samuel Aguilera

    (@samuelaguilera)

    In addition to the above, can you please confirm if you’re using the freshforms_post_has_gform filter maybe?

    Thread Starter Marty

    (@bozzmedia)

    Thanks Samuel!

    More info:

    Redis Object Cache
    NGINX page cache
    centos

    No filters in use, just the plugin activated.

    Plugin Author Samuel Aguilera

    (@samuelaguilera)

    More info:

    Redis Object Cache
    NGINX page cache
    centos

    Fresh Forms doesn’t support server caching directly. So if you’re getting Fresh Forms running with that setup, I’m assuming you have some other plugin installed that is doing the communication with the server side of things and supporting DONOTCACHEPAGE constant or using the cookie method (which requires a filter).

    In any case, the warning is added because for some reason the value for $post->ID is null, something that I can’t replicate in a default WordPress installation using the embedding methods and caching plugins listed as supported in the plugin description.

    Anyway, in the Development Version I have added an extra check to skip the pointed Fresh Forms function from running if $post->ID, which is required by the function, is not valid. This would prevent the warning.

    Please download the Development Version from the Advanced View and give it a try.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning: Attempt to read property “ID” on null’ is closed to new replies.