error_log notice

General questions pertaining to how certain issues can be resolved
Forum rules
1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"

error_log notice

Postby metal450 » 26 May 2016, 18:05

Hi there,

Running Suffusion 4.4.9 (latest) on WP 4.5.2 (latest), I sometimes get the following error_logs. They seem to appear when I visit the WP backend - but not 100% of the time (it isn't consistently reproducible). I'm running the site on localhost, so nobody can access it but me. Even if I know the exact 'page visit' that caused it to appear, revisiting the page immediately after will often not cause the log to appear a 2nd time (it seems to be random). I realize that they're just notices, and thus probably harmless - however, their appearance does make it quite a bit more cumbersome to identify when there's an actual problem being reported, so I'd really like to get it figured out. Any guidance would be appreciated...

Code: Select all
[27-May-2016 00:54:08] PHP Notice:  Trying to get property of non-object in D:\Work\Webroot\htdocs\wp-content\themes\suffusion\functions\actions.php on line 616
[27-May-2016 00:54:08] PHP Stack trace:
[27-May-2016 00:54:08] PHP   1. {main}() D:\Work\Webroot\htdocs\index.php:0
[27-May-2016 00:54:08] PHP   2. require() D:\Work\Webroot\htdocs\index.php:17
[27-May-2016 00:54:08] PHP   3. require_once() D:\Work\Webroot\htdocs\wordpress\wp-blog-header.php:19
[27-May-2016 00:54:08] PHP   4. include() D:\Work\Webroot\htdocs\wordpress\wp-includes\template-loader.php:75
[27-May-2016 00:54:08] PHP   5. get_header() D:\Work\Webroot\htdocs\wp-content\themes\suffusion\404.php:11
[27-May-2016 00:54:08] PHP   6. locate_template() D:\Work\Webroot\htdocs\wordpress\wp-includes\general-template.php:45
[27-May-2016 00:54:08] PHP   7. load_template() D:\Work\Webroot\htdocs\wordpress\wp-includes\template.php:531
[27-May-2016 00:54:08] PHP   8. require_once() D:\Work\Webroot\htdocs\wordpress\wp-includes\template.php:572
[27-May-2016 00:54:08] PHP   9. body_class() D:\Work\Webroot\htdocs\wp-content\themes\suffusion\header.php:54
[27-May-2016 00:54:08] PHP  10. get_body_class() D:\Work\Webroot\htdocs\wordpress\wp-includes\post-template.php:546
[27-May-2016 00:54:08] PHP  11. apply_filters() D:\Work\Webroot\htdocs\wordpress\wp-includes\post-template.php:755
[27-May-2016 00:54:08] PHP  12. call_user_func_array() D:\Work\Webroot\htdocs\wordpress\wp-includes\plugin.php:235
[27-May-2016 00:54:08] PHP  13. suffusion_get_body_classes() D:\Work\Webroot\htdocs\wordpress\wp-includes\plugin.php:0
[27-May-2016 00:54:08] PHP  14. suffusion_get_pseudo_template_class() D:\Work\Webroot\htdocs\wp-content\themes\suffusion\functions\filters.php:633
metal450
 
Posts: 91
Joined: 06 Feb 2010, 21:00

Re: error_log notice

Postby drake » 27 May 2016, 06:14

This is not a bug of Suffusion.

In my logic, only if the problem is consistent for you and can be reproduced on more sites, only then we can talk about a bug of theme.

In this case even for you, the notice isn't permanent and I can confirm that I never saw this notice on hundreds of sites in such many years. So, reasonably we can presume that is not a bug related to the theme, but something related to your particular configuration.

That's being said, is nearly impossible to help you as we cannot reproduce the problem for trying to find a solution. Can be anything from an outdated PHP version on the server to a defective plugin which load wrong it's settings in backend. I would start by following the standard procedure for debugging in WordPress - disable all your plugins, see if the problem is solved, then re-enable them one by one until you find the defective one.
drake
 
Posts: 6201
Joined: 26 Jul 2011, 07:56
Location: Constanta, Romania

Re: error_log notice

Postby metal450 » 27 May 2016, 09:09

drake wrote:This is not a bug of Suffusion. [...] I can confirm that I never saw this notice on hundreds of sites in such many years.

While I do see your logic, to assert that just because it hasn't been found before means it's not an issue in the theme is a bit presumptuous. I've found *many* legitimate bugs in *many* plugins, including those with millions of users. People find bugs in operating systems with hundreds of millions of users all the time. Just because you haven't seen it before is not evidence that it doesn't exist...

drake wrote:In this case even for you, the notice isn't permanent

So I went ahead and spent awhile debugging. While this isn't precisely the scenario that generated it before, I've been able to consistently reproduce it by disabling all other plugins, & visiting a "single" page for a custom post type (note: the plugin that adds support for that custom post type is disabled). I've been able to show that it *only* appears in Suffusion - never the default themes. It appears because in suffusion/functions/actions.php, line 161, $post is not an object, but there's no check for "isset($post->ID)". Of course visiting the page will still yield a 404 (until that custom post type is registered by enabling the plugin) - but properly checking the object will avoid the error_log.

I'm still not sure why the logs were sometimes appearing even with that plugin enabled, but considering that the stack traces are identical, I think it's reasonable to say that that the lack of that check was most likely the issue.
metal450
 
Posts: 91
Joined: 06 Feb 2010, 21:00


Return to Support Requests

Who is online

Users browsing this forum: Bing [Bot] and 6 guests