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

array(1)|extract_right(0) extracts an array with 1 value when TemplateCompile is enabled

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • Future
    • 4.0.1
    • None
    • Operating System: Linux
      PHP Version: 5.2.4
      Database and version: MySQL 5.0

    Description

      When using extract_right(0) to extract a value from an array the operator returns an empty array (correct) when TemplateCompile is disabled but returns one value from the input array (wrong) when TemplateCompile is enabled.

      Steps to reproduce

      Set site.ini to:
      [TemplateSettings]
      TemplateCompile=disabled

      Insert the following code into a template:

      {def $array = array(1)}
      {def $array_part_right = $array|extract_right(0)}
      
      {$array|attribute(show,1)}
      {$array_part_right|attribute(show,1)}
      

      Load the page.
      Result:

      Output of 2 arrays, one with value 1, one with no values.

      Now set
      TemplateCompile=enabled

      Result:

      Output of 2 arrays, both with value 1.

      This is wrong as extracting 0 values from an array should result in an empty array.

      Attachments

        Activity

          People

            unknown unknown
            mdi mdi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: