-2

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()
asked Oct 31, 2013 at 1:05
6
  • 12
    I'm sorry, I can't stop laughing at this question title. Commented Oct 31, 2013 at 1:07
  • And you want to do this instead of fix the problem.. why? Commented Oct 31, 2013 at 1:08
  • are only EE super-admins seeing the message? if so why bother? Commented Oct 31, 2013 at 1:08
  • 1
    Literally laughed so hard I almost peed. Commented Oct 31, 2013 at 1:09
  • 3
    looks like XY problem :) actually plugin should be fixed, if it is impossible error should be hidden at php side via php.ini or error_reporting, jquery of course can help to hide part of html, but it is so bad solution, I dont want to provide it Commented Oct 31, 2013 at 1:13

2 Answers 2

3

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);
    
answered Oct 31, 2013 at 1:15
Sign up to request clarification or add additional context in comments.

2 Comments

I had been given this as a fix: "public static function xxx()". The true fix is simply "static function xxx()". Thank you sanmai.
@MichaelVilleneuve no it's not. Why would you think that? javascript errors do not appear on page.
1

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();
answered Oct 31, 2013 at 1:10

9 Comments

this isn't a javascript solution.
...but is certainly a better solution than the hacky solution he is expecting. +1
true.. but the best solution is to fix the actual problem!
@Crayon Violent Huh? Oh maybe ! I'm not too sure the question is asked in a weird way. Either way, the question should be more on how to fix it then how to hide it :)
Have already been down that path. That line already sits in the page.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.