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

Argument type mismatch when using liferay-ui-asset-tags-selector tag in freemarker templates

    Details

      Description

      Reproduction steps:

      1) Add Asset Publisher portlet to a page
      2) Create custom ADT using the following freemarker template, set groupIds value:

      <#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />
      <@liferay_ui["asset-tags-selector"] groupIds=20192></@>
      

      After applying the custom template exception thrown:

      15:01:26,604 ERROR [http-bio-8080-exec-2][IncludeTag:128] Current URL /web/guest/page2 generates exception: com.liferay.portal.kernel.templateparser.TransformException: Unhandled exception
      java.lang.IllegalArgumentException: argument type mismatch
              at freemarker.ext.jsp.JspTagModelBase.setupTag(JspTagModelBase.java:87)
              at freemarker.ext.jsp.TagTransformModel.getWriter(TagTransformModel.java:103)
              at freemarker.core.Environment.visit(Environment.java:297)
              at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
              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.template.freemarker.FreeMarkerTemplate.processTemplate(FreeMarkerTemplate.java:121)
              at com.liferay.portal.template.AbstractSingleResourceTemplate.doProcessTemplate(AbstractSingleResourceTemplate.java:68)
              at com.liferay.portal.template.AbstractTemplate._write(AbstractTemplate.java:157)
              at com.liferay.portal.template.AbstractSingleResourceTemplate.processTemplate(AbstractSingleResourceTemplate.java:91)
              at com.liferay.portal.template.RestrictedTemplate.processTemplate(RestrictedTemplate.java:97)
              at com.liferay.portal.templateparser.Transformer.mergeTemplate(Transformer.java:256)
              at com.liferay.portal.templateparser.Transformer.transform(Transformer.java:145)
              at com.liferay.portlet.display.template.internal.PortletDisplayTemplateImpl.renderDDMTemplate(PortletDisplayTemplateImpl.java:452)
              at com.liferay.portlet.display.template.internal.PortletDisplayTemplateImpl.renderDDMTemplate(PortletDisplayTemplateImpl.java:479)
              at com.liferay.portlet.display.template.PortletDisplayTemplateUtil.renderDDMTemplate(PortletDisplayTemplateUtil.java:144)
              at org.apache.jsp.template_005frenderer.start_jsp._jspService(start_jsp:258)
      

      Reproduced on:
      ee-6.2.x:35e802a3f488b04d186d82c7c3e99c1a5b60595f
      master:6abb5b942e1ad75e57089b86d03d0accaa591474

      Analysis (Eduardo):
      " If you try topass groupIds param through the taglib in freemarker as a long[], it fails
      because the array is being wrapped by Freemarker with a different type."

      Additional info: original issue reported for Audience Targeting

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            krisztian.rostas Krisztian Rostas
            Participants of an Issue:
            Recent user:
            Summer Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              3 years, 14 weeks, 5 days ago

                Packages

                Version Package
                6.2.X EE