This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13776|Reply: 1

[Mutual Assistance] How to fix the Includes\cls_template.php on line 418 error in ecshop

[Copy link]
Posted on 2/20/2015 5:20:02 PM | | |

The problem I encountered before, I have been very distressed, how to solve it, and now I have finally found a solution, and now I will share it with you, the problem is as follows:
Strict Standards: Only variables should be passed by reference in upload\includes\cls_template.php on line 418
Line 418: $tag_sel = array_shift(explode(' ', $tag));

Workaround 1:
The problem with versions 5.3 and above should also be related to the configuration As long as line 418 splits this sentence into two sentences, there is no problem $tag_sel = array_shift(explode(' ', $tag)); Changed to:

$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
Because the parameters of array_shift are passed by reference, only specific variables can be passed by default above 5.3, and the value cannot be returned through the function
In the same way, when encountering function nesting errors, they can be written separately, and the errors will be solved naturally

As:
function get_dyna_libs($theme, $tmp)
{
$extsub = explode('.', $tmp);
$ext = end($extsub);
$tmp = basename($tmp,".$ext");
$sql = 'SELECT region, library, sort_order, id, number, type' .
' FROM ' . $GLOBALS['ecs']->table('template') .
" WHERE theme = '$theme' AND filename = '" . $tmp . "' AND type > 0 AND remarks=''".
' ORDER BY region, library, sort_order';
$res = $GLOBALS['db']->getAll($sql);
$dyna_libs = array();
foreach ($res AS $row)
{
$dyna_libs[$row['region']][$row['library']][] = array(
'id' => $row['id'],
'number' => $row['number'],
'type' => $row['type']
);
}
return $dyna_libs;
}

set $ext = end(explode('.', $tmp));
Change
$extsub = explode('.', $tmp);
$ext = end($extsub);

Solution 2 (Masking Error):

Or if configured like this: error_reporting = E_ALL | E_STRICT
The following settings are available in the php.ini:
error_reporting = E_ALL | E_STRICT

This means that coding standards warnings are displayed.
Joomla actually recommends canceling error output, which should be changed to if needed for debugging
error_reporting = E_ALL & ~E_NOTICE

The problem was solved.




Previous:QQ space information API interface
Next:Which personal blog system is better, let's talk about it
Posted on 2/21/2015 9:13:21 PM |
It is recommended to directly reduce the PHP version to PHP5.2.x
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com