A minor bug where 404 error pages result in PHP error
-
I haven’t found out how to contact the author of this plugin (Brian) so I’m posting this here.
(A minor bug – only shows up when debugging is set to ‘true’ in wp-config.php):
If the user goes to a WordPress page that doesn’t exist, then this plugin throws an error, which, if debugging is turned on, will display ugly text at the top of the page like so:
“Trying to get property of non-object in … ” (for 3 lines)
In order to fix this, I just added this to line 210 in per-page-sidebars.php:
if ( !$hostpost ) {
return;
}This way, if the object isn’t there it just returns before trying to set values, etc.
I know this isn’t really that big of a deal, but it’s a small detail that can help.If I could have found Brian’s email I would have just emailed him directly. Hopefully he sees this.
https://www.ads-software.com/extend/plugins/per-page-sidebars/
- The topic ‘A minor bug where 404 error pages result in PHP error’ is closed to new replies.