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

Freemarker themes Expression $htmlUtil is undefined

    Details

      Description

      1) Develop a freemarker template (you can follow Mika's blog post here: http://www.liferay.com/web/mika.koivisto/blog/-/blogs/using-freemarker-in-your-theme-templates)
      2) Deploy it
      3) Maximize on of the portlet

      You will get the following exception:

      22:05:21,180 ERROR [http-bio-8080-exec-4][IncludeTag:129] Current URL /web/guest/home?p_p_id=58&p_p_lifecycle=0&p_p_state=maximized&p_p_state_rcv=1&p_p_col_id=column-1&p_p_col_count=1 generates exception: javax.servlet.jsp.JspException: com.liferay.portal.kernel.template.TemplateException: Unable to process template b-theme_SERVLET_CONTEXT_/templates/portlet.ftl
      
      Expression $htmlUtil is undefined on line 5, column 29 in b-theme_SERVLET_CONTEXT_/templates/portlet.ftl.
      The problematic instruction:
      ----------
      ==> assignment: portlet_back_url=$htmlUtil.escapeHREF(portlet_display.getURLBack()) [on line 5, column 1 in b-theme_SERVLET_CONTEXT_/templates/portlet.ftl]
      ----------
      
      Java backtrace for programmers:
      ----------
      freemarker.core.InvalidReferenceException: Expression $htmlUtil is undefined on line 5, column 29 in b-theme_SERVLET_CONTEXT_/templates/portlet.ftl.
      	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
      	at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
      	at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
      	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
      	at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:86)
      	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
      	at freemarker.core.Assignment.accept(Assignment.java:90)
      	at freemarker.core.Environment.visit(Environment.java:221)
      	at freemarker.core.MixedContent.accept(MixedContent.java:92)
      	at freemarker.core.Environment.visit(Environment.java:221)
      	at freemarker.core.Environment.process(Environment.java:199)
      	at freemarker.template.Template.process(Template.java:237)
      	at com.liferay.portal.freemarker.FreeMarkerTemplate.processTemplate(FreeMarkerTemplate.java:122)
      	at com.liferay.portal.template.AbstractTemplate.processTemplate(AbstractTemplate.java:108)
      	at com.liferay.taglib.util.ThemeUtil.doIncludeFTL(ThemeUtil.java:344)
      	at com.liferay.taglib.util.ThemeUtil.doDispatch(ThemeUtil.java:169)
      	at com.liferay.taglib.util.ThemeUtil.includeFTL(ThemeUtil.java:113)
      	at com.liferay.taglib.util.ThemeUtil.include(ThemeUtil.java:96)
      	at com.liferay.taglib.theme.WrapPortletTag.doEndTag(WrapPortletTag.java:103)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brian.chan Brian Chan
                Reporter:
                zsolt.balogh Zsolt Balogh
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 49 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.2 CE GA3
                  6.2.X EE
                  7.0.0 M1