Question

I have a site running on Expression Engine. It appears the webserver was upgraded and now a plugin is throwing an error message. It doesn't seem to be impacting the operation of the site so while I try and remedy the issue I thought I could hide the PHP error message with jquery.

The error message is being put on the page before anything else -> before the DOCTYPE tag.

Here's one line:

Strict Standards: Non-static method Foxee_utils::check_cache() should not be called statically, assuming $this from incompatible context in /home/noelwhit/public_html/admin/modules/foxee/mod.foxee.php on line 228

I was toying with $(document).before() in some way but appear to be a little bit away from greatness just yet.

Thanks.

$(document).before()
Was it helpful?

Solution

This definitely shouldn't be fixed with jQuery. There are at least two ways to fix the problem with other than jQuery:

  1. The hard and proper way. Prefix Foxee_utils::check_cache() with static keyword:

    static function check_cache(/* skip */)
    
  2. The easy way. Add somewhere in the site configuration files, after other call to error_reporting() if there is one:

    error_reporting(error_reporting() & ~E_STRICT);
    

OTHER TIPS

That's a duplicate of many questions. But here's your answer

error_reporting(0)

At the top of your page


EDIT: I will strongly advise to not use this answer but if you really want to hack your way... use this answer to help you. Basically you take your inner html, then rewrite your page. But you should sincerely try to solve your problem instead of hiding it... The community is here to help you, make good use of it.

Here's a snippet of his answer :

var markup= document.documentElement.innerHTML;
markup= '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'+markup+'</html>';
document.open();
document.write(markup);
document.close();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top