Can you help me?๐
I have last versione of CCv5 on Joomla 3.9 with php 7.2 (i can't update to CCv6 now)
โ
the line of error is this:
I have last versione of CCv5 on Joomla 3.9 with php 7.2 (i can't update to CCv6 now)
โ
โ
PHP Deprecated: Function create_function() is deprecated in administrator/components/com_chronoconnectivity5/chronoconnectivity/helpers/lister.php on line 218
PHP Deprecated: Function create_function() is deprecated in /libraries/cegcore/helpers/html.php on line 59
the line of error is this:
$data_columns[$field]['function'] = create_function('$cell, $row', $functions[$k]);
https://stackoverflow.com/questions/48161526/php-7-2-function-create-function-is-deprecated
โ
Just change the code, not sure when v5 will be updated
โ
Just change the code, not sure when v5 will be updated
can you help me convert this?
โ
โ
$data_columns[$field]['function'] = create_function('$cell, $row', $functions[$k]);
instead, in the file
โ
/libraries/cegcore/helpers/html.php on line 59the error is on the row "return...."
โ
public static function styles($styles = array()){
if(is_string($styles)){
return $styles;
}
(-->ERROR HERE) return implode('; ', array_map(create_function('$k,$v', 'return $k.":".$v;'), array_keys($styles), array_values($styles)));
}
Hi saol89.
โ
The simplest fix is to set Site Error Reporting to System Default or to None which will prevent PHP Notices and Warnings from showing.
โ
The other one is to replace the code as follows:
โ
For the CC Notice try replacing :
create_function('$cell, $row', $functions[$k])
with
function($cell, $row) {return $functions[$k]}
โ
NB I don't see the CC Error so can't check that this is correct!
โ
For the CF notice in line 59 replace
create_function('$k,$v', 'return $k.":".$v;')
with
function($k, $v) {return $k.":".$v;}
โ
Bob
โ
NB You may need to retype these as copying code from the forum can include unwanted invisible characters!!!
โ
The simplest fix is to set Site Error Reporting to System Default or to None which will prevent PHP Notices and Warnings from showing.
โ
The other one is to replace the code as follows:
โ
For the CC Notice try replacing :
create_function('$cell, $row', $functions[$k])
with
function($cell, $row) {return $functions[$k]}
โ
NB I don't see the CC Error so can't check that this is correct!
โ
For the CF notice in line 59 replace
create_function('$k,$v', 'return $k.":".$v;')
with
function($k, $v) {return $k.":".$v;}
โ
Bob
โ
NB You may need to retype these as copying code from the forum can include unwanted invisible characters!!!
Hi Bob,
โ
In my case I made the modifications indicated by Bob and the Warning is not shown but the values that the functions entered in the Php functions box should return do not work.
โ
In my case I made the modifications indicated by Bob and the Warning is not shown but the values that the functions entered in the Php functions box should return do not work.
Hi, After evaluate a lot of alternatives it's now work.
โ
โ
โ
โ
PHP Deprecated: Function create_function() is deprecated in administrator/components/com_chronoconnectivity5/chronoconnectivity/helpers/lister.php on line 218โ
$data_columns[$field]['function'] = create_function('$cell, $row', $functions[$k]);to
$functionsphp = $functions[$k];
$data_columns[$field]['function'] = function($cell, $row) use ($functionsphp) {return eval($functionsphp);};
This topic is locked and no more replies can be posted.