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

    XMLWordPrintable

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            4d91e976-d41f-487b-ae85-f7216bd06dac@accounts.ibexa.co Felix Woldt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: