1

I having these errors on my website:

Strict Standards: Non-static method modJumiHelper::getCodeWritten() should not be called statically in /home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php on line 17

Strict Standards: Non-static method modJumiHelper::getStorageSource() should not be called statically in /home/kmxsiksf/www/modules/mod_jumi/mod_jumi.php on line 18

Here is the mod_jumi.php (line 17 and 18 start respectively with $code_written and $storage_source)

defined('_JEXEC') or die('Restricted access');
if(!defined('DS')){
    define('DS',DIRECTORY_SEPARATOR);
}
// Include the functions only once
require_once(dirname(__FILE__).DS.'helper.php');


$code_written   = modJumiHelper::getCodeWritten($params); //code written or ""
$storage_source = modJumiHelper::getStorageSource($params); //filepathname or record id or ""

if(is_int($storage_source)) { //it is record id
    $code_stored = modJumiHelper::getCodeStored($storage_source); //code or null(error]
}

require(JModuleHelper::getLayoutPath('mod_jumi'));

I found many solution for this problem to transform the function into a non static one but because I don't know much about PHP, I couldn't find a way to make them work.

Thanks a lot for your help!

MagTun
  • 5,619
  • 5
  • 63
  • 104

1 Answers1

3

This error is caused because the functions getCodeWritten and getStorageSource are not static functions.

i.e.

Instead of being declared like so:

public static function getCodeWritten()

They are being declared like this:

public function getCodeWritten()

Be warned that "fixing" this might cause other issues. Your best bet is to contact the people who created the extension.

Wayne Whitty
  • 19,513
  • 7
  • 44
  • 66
  • Thanks for your help! Do you mean that getCodeWritten and getStorageSource are declared in another .php – MagTun Jun 24 '14 at 09:11
  • @Arone Yes. If I were you, I'd have a look at the class file called modJumiHelper. – Wayne Whitty Jun 24 '14 at 09:12
  • Thanks a lot, it's working! (for the other replace on line 14 and 18 in /modules/mod_jumi/helper.php) and also if you have notice like : Strict Standards: Only variables should be assigned by reference in... delete all the "&" on those lines. – MagTun Jun 24 '14 at 09:15