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

Blog Display Templates with portlet preferences script causes NonStringException.

    Details

      Description

      CASE 1

      1. Add Blog portlet
      2. Configuration -> Manage Display Templates for Liferay.
      3. Add a Blog Display Template
        • Clear all script
        • Click [Portlet Preferences]
        • Save
      4. Close the dialog
      5. Open Blogs configurations
      6. Select created Display Template
      7. Save

      CASE 2

      1. Add Blog portlet
      2. Configuration -> Manage Display Templates for Liferay.
      3. Add a Blog Display Template
        • Click [Blogs Entries]
        • Click [Portlet Preferences]
        • Save
      4. Close the dialog
      5. Open Blogs configurations
      6. Select created Display Template
      7. Save
      8. Add new blogs, publish

      Expected result:
      There is no error/exception in the console.

      Actual result:
      An error occurred while processing the template and console will throw exception.

      8:00:52,740 ERROR [RuntimePageImpl-18][runtime:96] Template processing error: "Error on line 1, column 3 in 10157#10197#11464\nExpecting a string, date or number here, Expression portletPreferences is instead a freemarker.template.SimpleHash"
      
      rror on line 1, column 3 in 10157#10197#11464
      xpecting a string, date or number here, Expression portletPreferences is instead a freemarker.template.SimpleHash
      he problematic instruction:
      ---------
      => ${portletPreferences} [on line 1, column 1 in 10157#10197#11464]
      ---------
      
      ava backtrace for programmers:
      ---------
      reemarker.core.NonStringException: Error on line 1, column 3 in 10157#10197#11464
      xpecting a string, date or number here, Expression portletPreferences is instead a freemarker.template.SimpleHash
             at freemarker.core.Expression.getStringValue(Expression.java:126)
             at freemarker.core.Expression.getStringValue(Expression.java:93)
             at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
             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:127)
             at com.liferay.portal.template.RestrictedTemplate.processTemplate(RestrictedTemplate.java:55)
             at com.liferay.portal.templateparser.Transformer.mergeTemplate(Transformer.java:637)
             at com.liferay.portal.templateparser.Transformer.transform(Transformer.java:168)
             at com.liferay.portlet.portletdisplaytemplate.util.PortletDisplayTemplateImpl.renderDDMTemplate(PortletDisplayTemplateImpl.java:351)
             at com.liferay.portlet.portletdisplaytemplate.util.PortletDisplayTemplateImpl.renderDDMTemplate(PortletDisplayTemplateImpl.java:284)
             at com.liferay.portlet.portletdisplaytemplate.util.PortletDisplayTemplateUtil.renderDDMTemplate(PortletDisplayTemplateUtil.java:76)
             at org.apache.jsp.html.portlet.blogs.view_jsp._jspService(view_jsp.java:1139)
             at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
             at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
             at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
             at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
             at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
             at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
             at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
             at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3852)
             at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
             at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
             at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
             at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
             at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
             at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
             at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
             at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
             at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
             at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:331)
             at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:128)
             at com.liferay.portal.struts.PortletRequestProcessor.doInclude(PortletRequestProcessor.java:370)
             at com.liferay.portal.struts.PortletRequestProcessor.doForward(PortletRequestProcessor.java:338)
             at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
             at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
             at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
             at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
             at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:234)
             at com.liferay.portlet.StrutsPortlet.include(StrutsPortlet.java:296)
             at com.liferay.portlet.StrutsPortlet.doView(StrutsPortlet.java:157)
             at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:213)
             at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
             at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
             at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
             at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
             at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
             at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:618)
             at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:677)
             at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:379)
             at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1232)
             at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
             at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
             at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
             at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
             at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655)
             at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138)
             at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
             at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
             at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
             at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:125)
             at com.liferay.portal.layoutconfiguration.util.PortletRenderer.access$4(PortletRenderer.java:107)
             at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:180)
             at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:1)
             at com.liferay.portal.kernel.executor.CopyThreadLocalCallable.call(CopyThreadLocalCallable.java:69)
             at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
             at java.util.concurrent.FutureTask.run(FutureTask.java:138)
             at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
             at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
             at java.lang.Thread.run(Thread.java:662)
      

        Attachments

        1. attachment.JPG
          attachment.JPG
          124 kB
        2. attachment.JPG
          attachment.JPG
          139 kB

          Activity

            People

            • Assignee:
              he.song Serena Song (Inactive)
              Reporter:
              he.song Serena Song (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 45 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 M1