Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30293

legacy template navigator/google.tpl - PHP Notice - Array to string conversion

    Details

      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 loop=$view_parameters}
      {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

        Activity

        Show
        André Rømcke added a comment - Merged in https://github.com/ezsystems/ezpublish-legacy/commit/a5308a86df42305eb8876e56a13f53e73660ca6d

          People

          • Assignee:
            Unassigned
            Reporter:
            Felix Woldt
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: