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

Adding content with multi-select field with no selected options throws exception

    Details

      Description

      Steps to reproduce issue:

      1. Add a Web Content Structure
        • Add a 'Select' field
        • Under 'Multiple', click 'Yes'
        • Save
      2. Add a template for the multi-select structure
      3. Add a Web Content article using the multi-select structure and template
        • Add a title
        • Do not select any option in the multi-select field
        • Publish

      Expected result: An alert is displayed, warning user that no options were selected; no console error is thrown.
      Actual result: The multi-select field no longer displays after attempting to publish the article. A generic alert is thrown, and an exception is thrown at time of publishing:

      22:42:00,348 ERROR [http-bio-8080-exec-10][IncludeTag:128] Current URL /group/guest/~/control_panel/manage?p_p_id=com_liferay_journal_web_portlet_JournalPortlet&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&_com_liferay_journal_web_portlet_JournalPortlet_mvcPath=%2Fedit_article.jsp&p_p_auth=6dIqnpQE generates exception: com.liferay.portal.kernel.exception.PortalException: com.liferay.portal.kernel.template.TemplateException: Unable to process template com/liferay/dynamic/data/mapping/dependencies/alloy/option.ftl
      freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:_==> field.getRenderedValue(requestedLocale, valueIndex)  [in template "com/liferay/dynamic/data/mapping/dependencies/init.ftl" at line 79, column 31]__----_Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??_----__----_FTL stack trace ("~" means nesting-related):_	- Failed at: #assign fieldValue = field.getRendere...  [in template "com/liferay/dynamic/data/mapping/dependencies/init.ftl" at line 79, column 9]_	- Reached through: #include "../init.ftl"  [in template "com/liferay/dynamic/data/mapping/dependencies/alloy/option.ftl" at line 1, column 1]_---- [Sanitized]
      	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
      	at freemarker.core.Assignment.accept(Assignment.java:136)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.MixedContent.accept(MixedContent.java:54)
      	at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
      	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.MixedContent.accept(MixedContent.java:54)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.Environment.include(Environment.java:2072)
      	at freemarker.core.Include.accept(Include.java:167)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.MixedContent.accept(MixedContent.java:54)
      	at freemarker.core.Environment.visit(Environment.java:324)
      	at freemarker.core.Environment.process(Environment.java:302)
      	at freemarker.template.Template.process(Template.java:325)
      	at com.liferay.portal.template.freemarker.FreeMarkerTemplate.processTemplate(FreeMarkerTemplate.java:121)
      	at com.liferay.portal.template.AbstractSingleResourceTemplate.processTemplate(AbstractSingleResourceTemplate.java:79)
      	at com.liferay.dynamic.data.mapping.render.impl.DDMFormFieldFreeMarkerRenderer.processFTL(DDMFormFieldFreeMarkerRenderer.java:621)
      	at com.liferay.dynamic.data.mapping.render.impl.DDMFormFieldFreeMarkerRenderer.processFTL(DDMFormFieldFreeMarkerRenderer.java:606)

      Reproduced on:
      Tomcat 7.0.62 + MySQL 5.6
      Portal Master GIT ID: 0e77cea759507253b0d91aa660218a954db8a5c2.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 33 weeks, 5 days ago

                  Packages

                  Version Package
                  7.0.0 Beta 6