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

        Activity

          People

            unknown unknown
            2b274289-6c7c-4b95-a70d-ca6c4a846602@accounts.ibexa.co j h
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: