dancriel
Member
Posted 1 year ago #
Hi,
It looks like popularity contest stopped working for me and I see the following PHP error in my logs.
HP Fatal error: Call to a member function create_post_record() on a non-object in /<webserver path>/wp-content/plugins/popularity-contest/popularity-contest.php on line 2149
Using Popularity Contest Version 2.0b2
Anyone else have this problem?
dancriel
Member
Posted 1 year ago #
That's supposed to be "PHP Fatal Error", not "HP".
It looks like the problem might be that the global $akpc variable is false when akpc_publish() gets called.
Thanks in advance for anyone who can help.
jproducer
Member
Posted 1 year ago #
This fix handled all my errors Patched Plugin
dancriel
Member
Posted 1 year ago #
Appreciate the reply jproducer, that link goes to a patch for an old version of popularity contest designed for WordPress 2.5 though...the PHP Fatal Error fix discussed in that article does not apply to the latest version of PC.
I made an attempt to fix this error on my own by changing line 2149 from this:
$akpc->create_post_record($post_id);
To this:
if ($akpc) $akpc->create_post_record($post_id);
dancriel
Member
Posted 1 year ago #
Will mark this thread as resolved if this works.
dancriel
Member
Posted 1 year ago #
the above fix eliminates the error.