Title: [Plugin: Popularity Contest] PHP Fatal error
Last modified: August 19, 2016

---

# [Plugin: Popularity Contest] PHP Fatal error

 *  Resolved [dancriel](https://wordpress.org/support/users/dancriel/)
 * (@dancriel)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/)
 * 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?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [dancriel](https://wordpress.org/support/users/dancriel/)
 * (@dancriel)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/#post-1994641)
 * 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](https://wordpress.org/support/users/jproducer/)
 * (@jproducer)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/#post-1994994)
 * This fix handled all my errors [Patched Plugin](http://wpguy.com/tips/popularity-contest-plugin-compatibility-with-wordpress-25/)
 *  Thread Starter [dancriel](https://wordpress.org/support/users/dancriel/)
 * (@dancriel)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/#post-1994996)
 * 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);`
 *  Thread Starter [dancriel](https://wordpress.org/support/users/dancriel/)
 * (@dancriel)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/#post-1994997)
 * Will mark this thread as resolved if this works.
 *  Thread Starter [dancriel](https://wordpress.org/support/users/dancriel/)
 * (@dancriel)
 * [15 years ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/#post-1995000)
 * the above fix eliminates the error.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Popularity Contest] PHP Fatal error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/popularity-contest.svg)
 * [Popularity Contest](https://wordpress.org/plugins/popularity-contest/)
 * [Support Threads](https://wordpress.org/support/plugin/popularity-contest/)
 * [Active Topics](https://wordpress.org/support/plugin/popularity-contest/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/popularity-contest/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/popularity-contest/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [dancriel](https://wordpress.org/support/users/dancriel/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/plugin-popularity-contest-php-fatal-error/#post-1995000)
 * Status: resolved