Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-104429

In page fragments, Freemarker's logical AND operator does not work

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 7.1.10 DXP FP14
    • Fix Version/s: None
    • Component/s: WCM > Fragments
    • Labels:
      None

      Description

      Consider the following Freemarker script in a page fragment:

      [#if 1==1]
        yes
      [/#if]
      

      This works as expected, it outputs 'yes'.
      Change the expression to use the OR operator:

      [#if 1==1 || 2 == 2]
       yes
      [/#if]
      

      This works as well, it outputs 'yes'.

      But all of the AND operator syntax options do not output anything, they fail silently.

      [#if 1==1  && 2 == 2]
       yes
      [/#if]
      
      [#if 1==1  && 2 == 2]
       yes
      [/#if]
      
      [#if 1==1  \and 2 == 2]
       yes
      [/#if]
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                9 weeks, 4 days ago

                Packages

                Version Package