$wpfc_entry_views error
When I am viewing the single page of a sermon, it is giving an error that reads:
"Warning: Creating default object from empty value in .../wp-content/plugins/sermon-manager-for-wordpress/includes/entry-views.php on line 62"
You should do a check to see if that variable has a value before putting a value into it.
Example:
/ Set the post ID for later use because we wouldn't want a custom query to change this. / if (isset($wpfc_entry_views)) { $wpfc_entry_views->post_id = $post->ID; }
Fix for page: http://pastebin.com/RecDHpyP
Comments (7)
-
repo owner -
reporter Even if you put a filter in there so I can reset it via the theme or a plugin. It's not nice to have that error constantly showing up.
It shows because I have wp_debug on
-
reporter What if you did this instead:
if (isset($wpfc_entry_views->post_id)) { $wpfc_entry_views->post_id = $post->ID; }
I don't understand how it could possibly break anything. All it would be doing is checking to see if it has a value.
If it doesn't have a value, it's not counting anything anyway - so how could it break any counter?
If it has a value than it continues as normal.
-
reporter Or perhaps this should be used when that array is created (I'm not totally sure where that is)
-
Account Deactivated I have a fix for this, but for some reason getting access denied when I try to create a pull request.
Moveplugins, I don't think it's a great idea to be running with wp_debug set to on in a live or production environment. When it's off the error doesn't show.
This is also the same as issue
#19. Can you link issues on bitbucket? -
reporter I don't run wp_debug in a live environment. I run it in my production environment so that I catch errors as soon as they happen.
-
repo owner - changed status to resolved
- Log in to comment
This only occurs on certain versions of php. See: https://bitbucket.org/wpforchurch/sermon-manager-for-wordpress/issue/19/object-creation-warning-in-php-54
Unfortunately, this fix breaks the counter, but I'll look into it more