[FIXED] Permanently DELETE a QUESTION

4.58K viewsIssues
0

Anspress 3.0.5

Permanently delete a Question crashes (just delete works):

PHP Notice:  Object of class WP_Post could not be converted to int in /home/wp-content/plugins/anspress-question-answer/includes/subscriber.php on line 91

PHP Catchable fatal error:  Object of class WP_Post could not be converted to string in /home/wp-content/plugins/anspress-question-answer/includes/subscriber.php on line 185

Thanks

edited question

Hello @Cagliostro,
Thanks for reporting I will check.

0

Fixed At Github

0

Delete permanently a Question is not working only if there are some answers. If question has no answers, then it is working.

And this is because when ap_subscribers_count is parsing $item_id, then for question it is returning correct value, but for answer it is returning whole post meta data.

I added a quick fix for that, not pretty, but it is working:

if ( array_key_exists('ID', $item_id) ){
		$item_id = $item_id->ID;
	}

added in function ap_subscribers_count (subscribers.php) before:

$key = $item_id.'_'.$activity;