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

optimize/improve AND logic operator in template language

    XMLWordPrintable

    Details

      Description

      currently the AND operator evaluates all template operators that are its parameters, before the "and" operation is done.
      This is not optimized and causes unexpected warnings/errors.

      Example:

      {if and(ezhttp_hasvariable( 'SearchContentClassID', 'get' ), ezhttp( 'SearchContentClassID', 'get')|ne("-1")) }
          ...
          ...
      {else}
          ...
      {/if}
      

      executes both operators (ezhttp_hasvariable and ezhttp) even if SearchContentClassID does not exist. This causes template error:

      Error: eZTemplate:ezhttp 	Dec 22 2011 15:52:37
      Unknown get variable 'SearchContentClassID'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              unknown unknown
              Reporter:
              jh.ez.no Jarosław-- Heba
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated: