JUMI Errors

A multipurpose module, plugin and component

JUMI Errors

New postby amogh » Fri May 13, 2011 11:21 pm

I just installed JUMI on my localhost Joomla 1.6 version. It got installed, but it shows errors on the website. The following errors are reported on the top of the website(the rest of the content was displayed as is):
trict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumirouter\jumirouter.php on line 20

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumirouter\jumirouter.php on line 33

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumirouter\jumirouter.php on line 35

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumirouter\jumirouter.php on line 36

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumirouter\jumirouter.php on line 55

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumi\jumi.php on line 25

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\joomla16\plugins\system\jumi\jumi.php on line 29

Notice: Trying to get property of non-object in C:\xampp\htdocs\joomla16\plugins\system\jumi\jumi.php on line 30

Notice: Trying to get property of non-object in C:\xampp\htdocs\joomla16\plugins\system\jumi\jumi.php on line 39

What should I do?? Please help...
amogh
 
Posts: 1
Joined: Fri May 13, 2011 11:17 pm

Re: JUMI Errors

New postby DevByStarlight » Sun May 22, 2011 8:05 am

And, now the temporary hack version ...

The earlier reply message is the quick and easy way to disable the warnings. But we normally want those warnings and E_STRICT reports, right?

Sooooo, here's how I temporarily hacked the jumi code by disabling and restoring the message levels at runtime.

Paste the code below at the beginning of the class definitions for Jumi and Jumirouter
  • In ./jumi/jumi.php ... right after "class plgSystemJumi extends JPlugin"
  • In ./jumirouter/jumirouter.php ... right after "class plgSystemJumiRouter extends JPlugin"

Code: Select all
   ////
   // Begin DevByStarlight Temporary Hack
   private $originalErrorFlags;
   private $errorHackDebug = true;
   function HideJumiErrors(){
      $this->originalErrorFlags = error_reporting();  // ini_get('error_reporting'); //--- Using INI version may not be correct if other runtime changes occur
      if ( $this->errorHackDebug == true ) {
         echo 'Quiet Jumi Before:' . $this->originalErrorFlags . "<br />\n";
      }
      error_reporting(0); // Hide messages temporarily - note: may also hide errors in any of our Jumi code too :(
   }
   function RestoreJumiErrors(){
      // Set error level back to what it was
      error_reporting($this->originalErrorFlags);
      if ( $this->errorHackDebug == true ) {
         echo 'Quiet Jumi After:' . error_reporting() . "<br /><br />\n";
      }
   }
   // End DevByStarlight Temporary Hack
   ////


The for each Strict and Notice message, call "HideJumiErrors()" and "RestoreJumiErrors" before and after the offending line.

Example: (using the jumi.php "onAfterRender" case)
Code: Select all
      $this->HideJumiErrors();
      $mainframe = &JFactory::getApplication();
      $this->RestoreJumiErrors();


Repeat for each of the others.

There were two exceptions ...
1. parseJumiRouter (in jumirouter.php) ... the function isn't part of the class definition so
Code: Select all
   $origErrorFlags = error_reporting();
   error_reporting(0);
   $db =& JFactory::getDBO();
   error_reporting($origErrorFlags);


2. onAfterRender (in jumi.php) ... the line in question is in the "if()" logic test.

So you can either make sure RestoreJumiErrors() is called along both true or false paths. Or use the following instead.

Code: Select all
        $this->HideJumiErrors();
        $thingie = ($pluginParams->hide_code == 1);
        $this->RestoreJumiErrors();
        if ( $thingie ) {
            $content = preg_replace( $regex, '', $content );
            return true;
        }


Again, we are just hiding the errors and not really fixing anything.

Also, The HideJumiErrors and RestoreJumiErrors write out "before" and "after" values of the current flags - the numbers should be the same. Once the errors are gone and appears things are working correctly, just set ...
Code: Select all
   private $errorHackDebug = false;

... in both the jumi.php and jumirouther.php

~~

Sooo ... now you have the php.ini workaround or the hack jumi code to quiet the errors locally and temporarily.

Personally, I like the temporary quiet hack so I can keep E_STRICT enabled.

Pick whichever makes sense for you.
DevByStarlight
 
Posts: 11
Joined: Sun May 15, 2011 9:07 pm

Re: JUMI Errors

New postby DevByStarlight » Sun May 22, 2011 8:18 am

One final item.

If you use GTranslate ... well, you see a similar error.

Occurs at "mod_gtranslate\mod_gtranslate.php on line 13"

(I used the same workaround described earlier)

And, for that matter, **many** of Joomla's extensions have such errors.

(Probably because the E_STRICT flag was not the default php.ini setting until the more recent release versions - so nobody noticed or knew about the problems.)

PhocaGallery has same "issues" and so forth and so on.

Yeah, it's a pain to go through and use the temporary hide and restore hack. But actually doesn't take too long to do. And the best thing is can get E_STRICT enabled to detect problems in your own templates, extensions, etc.!

Since I did the long-winded explanation above, and Jumi's so popular anyway, I'm pointing others here whenever I run into the issue on another forum.

Just remember it will re-appear when you install an update of the plugin (unless the developer fixes it of course)

P.S - I went back to look through my Joomla 1.5.x sites in development mode with the new PHP with E_STRICT enabled and (Sweet maple syrup, Batman!) there were tons of these messages.
DevByStarlight
 
Posts: 11
Joined: Sun May 15, 2011 9:07 pm


Return to Jumi

Who is online

Users browsing this forum: No registered users and 1 guest

cron