Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Trying to get property of non-object: $post->post_modified_gmt;

$
0
0

Replies: 0

Hi,

We have a pretty popular site, and Akismet throws several hundred ErrorExceptions per day for this:

ErrorException: Trying to get property of non-object
#13 /srv/www/htdocs/SITE.com/public/wp-content/plugins/akismet/class.akismet.php(174): handleError
#12 /srv/www/htdocs/SITE.com/public/wp-content/plugins/akismet/class.akismet.php(174): auto_check_comment
#11 /srv/www/htdocs/SITE.com/public/wp-content/plugins/akismet/class.akismet.php(1215): pre_check_pingback
#10 [Anonymous function](0): call_user_func_array
#9 wp-includes/class-wp-hook.php(298): apply_filters
#8 wp-includes/class-wp-hook.php(323): do_action
#7 wp-includes/plugin.php(453): do_action
#6 wp-includes/class-wp-xmlrpc-server.php(6227): pingback_ping
#5 wp-includes/IXR/class-IXR-server.php(115): call
#4 wp-includes/IXR/class-IXR-server.php(65): serve
#3 wp-includes/IXR/class-IXR-server.php(27): __construct
#2 wp-includes/IXR/class-IXR-server.php(35): IXR_Server
#1 wp-includes/class-wp-xmlrpc-server.php(197): serve_request
#0 xmlrpc.php(84): null

The issue is here: akismet/class.akismet.php:174:

$comment[ 'comment_post_modified_gmt' ] = $post->post_modified_gmt;

$post is null. I’m not sure exactly why, but could you add a check for null here?

I’m using Akismet 3.3, which is the latest version right now.

Thanks.


Viewing all articles
Browse latest Browse all 59525