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

web content templates - there is no .vars[''] in velocity language

    Details

      Description

      Default velocity macros for Web Content Structure fields are syntactically incorrect.

      LPS-66743 puts .vars[] into velocity macros, however that is valid only for Freemarker language.

      The last good version is : 6.2.10-SP15 with portal-130.

      Steps to reproduce

      1. Go to Admin > Site Administration > Content > Web Content
      2. Go to Manage > Structures and add a structure with, for example, a text field called Text1777, save
      3. Associate a Velocity template to such structure
      4. Call the text field by clicking on it on "Text" (left side) under "Fields"

        Expected

        Template editor to add $Text1777.getData()

        Actual behavior

        Such action will add $.vars['Text1777'].getData(), which looks like an incorrect Freemarker for $

        {.vars['Text1777'].getData()}

      warning

      It needs a full test for all the field types + switching on repeatable (and without repeatable)
      So a deeper test:

      1. create a web content structure with
        1. all the fields
        2. plus all the fields sets them to repeatable
      2. create a velocity template for this
      3. create a content with this structure
      4. display the content in a Web Content Display portlet
      5. check if everything works well
      6. do the same with Freemarker Template

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  2 years, 39 weeks, 1 day ago

                  Packages

                  Version Package
                  6.2.X EE