• Resolved Marty

    (@bozzmedia)


    These debug warnings started showing up after an update to PHP 8. Anyone else running into this?

    PHP Warning:  Undefined array key "comment_post_ID" in /home/redacted/public_html/wp-content/plugins/akismet/class.akismet.php on line 187
    PHP Warning:  Undefined array key "comment_post_ID" in /home/redacted/public_html/wp-content/plugins/akismet/class.akismet.php on line 198
    PHP Warning:  Undefined array key "comment_post_ID" in /home/redacted/public_html/wp-content/plugins/akismet/class.akismet.php on line 230
    
    PHP Warning:  Undefined array key "comment_author" in /home/redacted/public_html/wp-includes/comment.php on line 2094
    PHP Warning:  Undefined array key "comment_author_url" in /home/redacted/public_html/wp-includes/comment.php on line 2112
    PHP Warning:  Undefined array key "comment_author_email" in /home/redacted/public_html/wp-includes/comment.php on line 2114

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Christopher Finke

    (@cfinke)

    Given that you’re also getting warnings from core code, I don’t think Akismet is the cause of this. My guess would be that another comment is storing data in the comments database table but not populating comment_post_ID, comment_author, comment_author_url, and comment_author_email, which both Akismet and the code code expect.

    You could find out by just seeing what information is in the wp_comments table (if you have that ability) or by listing your plugins here, and we can probably determine it.

    Thread Starter Marty

    (@bozzmedia)

    Thanks @cfinke!

    We are also using the wpdiscuz plugin.

    When I review the database it appears there are no blank comment_post_ID entries in wp_comments

    Plugin Author Christopher Finke

    (@cfinke)

    I’ll do some testing to see if I can reproduce this, but can you tell when these warnings appear? Is it immediately after submitting a new comment?

    Thread Starter Marty

    (@bozzmedia)

    I’m not certain, these are just entries in our debug.log. If I can find a specific source I will update here. Thanks for looking into it!

    Thread Starter Marty

    (@bozzmedia)

    It seems the URL that is reported with the error is:

    /wp-admin/admin-ajax.php

    Newer trace:

    Undefined array key “comment_author_email”

    in wp_filter_comment called at /home/public_html/production/wp-content/plugins/akismet/class.akismet.php (333)
     in Akismet::set_last_comment called at /home/public_html/production/wp-content/plugins/akismet/class.akismet.php (313)
     in Akismet::auto_check_comment called at /home/public_html/production/wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php (547)
     in WpdiscuzCore::saveEditedComment called at /home/public_html/production/wp-includes/class-wp-hook.php (307)
     in WP_Hook::apply_filters called at /home/public_html/production/wp-includes/class-wp-hook.php (331)
     in WP_Hook::do_action called at /home/public_html/production/wp-includes/plugin.php (476)
     in do_action called at /home/public_html/production/wp-admin/admin-ajax.php (187)
    Thread Starter Marty

    (@bozzmedia)

    I have also inquired here in case the wpDiscuz dev (@gvectors-team) has any thoughts about how the WpdiscuzCore::saveEditedComment function is involved:

    https://www.ads-software.com/support/topic/potential-issue-with-akismet-undefined-array-key-php-8/

    • This reply was modified 2 years ago by Marty.
    Plugin Author Christopher Finke

    (@cfinke)

    It looks like wpDiscuz will be addressing this; I’ll watch for their fix and check whether we can improve Akismet to handle similar situations more gracefully.

    Thread Starter Marty

    (@bozzmedia)

    Thanks @cfinke, I appreciate your attention and help with this issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘PHP Warning: Undefined array key “comment_post_ID”’ is closed to new replies.