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

Render issue when using the 'request' variable in the Web Content template

    Details

      Description

      1. Create a Web Content Structure using the following content:

      <root available-locales="en_US" default-locale="en_US">
      	<dynamic-element dataType="html" fieldNamespace="ddm" indexType="keyword" name="HTML1517" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-text-html" width="small">
      		<meta-data locale="en_US">
      			<entry name="label">
      				<![CDATA[HTML]]>
      			</entry>
      			<entry name="predefinedValue">
      				<![CDATA[]]>
      			</entry>
      			<entry name="tip">
      				<![CDATA[]]>
      			</entry>
      		</meta-data>
      	</dynamic-element>
      </root>
      

      3. Create a Web Content Template for this newly created structure using the following content (FreeMarker):

      ‚Äč<#assign themeImagePath = request['theme-display']['path-theme-images']>
      ${themeImagePath}
      

      4. Create a new Web Content using the newly created structure. Enter 'foo' as its title, and enter 'This is foo' as its content.
      5. Add a Web Content Display portlet on the default Liferay page to display this newly created Web Content.
      6. Add a Web Content Search portlet to the same page to search about the newly created Web Content. Enter 'foo' in the Search textbox and press

      The following error is shown in the console:
      15:20:13,728 ERROR [http-bio-8080-exec-10][runtime:96] Template processing error: "Expression request['theme-display'] is undefined on line 1, column 27 in 10157#10197#10549."

      Expression request['theme-display'] is undefined on line 1, column 27 in 10157#10197#10549.
      The problematic instruction:
      ----------
      ==> assignment: themeImagePath=request['theme-display']['path-theme-images'] on line 1, column 1 in 10157#10197#10549
      ----------

      Java backtrace for programmers:
      ----------
      freemarker.core.InvalidReferenceException: Expression request['theme-display'] is undefined on line 1, column 27 in 10157#10197#10549.
      at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 19 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 M7