Strict Standards: Non-static method modJumiHelper::getCodeWritten() should not be called statically

老子叫甜甜 提交于 2019-12-11 14:42:34

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/24382526/strict-standards-non-static-method-modjumihelpergetcodewritten-should-not-b

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!