Details
-
Bug
-
Resolution: Fixed
-
Low
-
2018.09
-
PHP7
Description
Running legacy stack oh a php7 setup you will get a php notice if the navigator/google tpl is used.
Notice: Array to string conversion in ....htdocs/var/cache/template/compiled/google-7b8fd8d96226f41cdb0c627b3e9ad3dd.php on line 487
The $view_parameters variable has a new item _custom which is an array
example url ..../(my_viewparam1)/value1
{$view_parameters|attribute( 'show', 3 )}
Attribute Type Value
offset boolean false
year boolean false
month boolean false
day boolean false
namefilter boolean false
_custom array Array(1)
>my_viewparam1 string 'value1'
my_viewparam1 string 'value1'
to avoid this warning we have to ignore the _custom value ...
old google.tpl code:
...
{section-exclude match=$:key|eq('offset')}
{section-exclude match=$:item|eq('')}
{set view_parameter_text=concat($:view_parameter_text,'/(',$:key,')/',$:item)} {/section}
...
new code
...{section loop=$view_parameters} {section-exclude match=$:key|eq('offset')} {section-exclude match=$:key|eq('_custom')} {section-exclude match=$:item|eq('')} {set view_parameter_text=concat($:view_parameter_text,'/(',$:key,')/',$:item)} {/section}
...
related tpl files:
ezpublish_legacy/design/standard/templates/navigator/google.tpl
ezpublish_legacy/design/admin/templates/navigator/google.tpl