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

Upgrade from 7.0 fails when visibility expression has logical operand

    Details

      Description

      Steps to reproduce:

      1. Using a Liferay 7.0 instance, go to Content > Forms and create a new form containing the following fields:
        1. Text field with label "text";
        2. Text field with label "hiddenText" and visibility expression (under the "Show More Options" accordion): contains(text, "show") || contains(text, "appear")
      2. Optional step: put that form on a page and test that the visibility expression works;
      3. Shut down the server;
      4. Run the master's upgrade tool on the same database and remember to move the document library from the old bundle to the new one.

      Actual result:
      Master and 7.3.x: Upgrade finishes successfully, but expression doesn't work as before. If you try to edit the form, you won't be able to due to the following exception:

      2020-12-21 18:49:21.995 ERROR [http-nio-8080-exec-4][render_portlet_jsp:131] null
      org.antlr.v4.runtime.InputMismatchException
      	at org.antlr.v4.runtime.BailErrorStrategy.recoverInline(BailErrorStrategy.java:85)
      	at org.antlr.v4.runtime.Parser.match(Parser.java:223)
      	at com.liferay.dynamic.data.mapping.expression.internal.parser.DDMExpressionParser.expression(DDMExpressionParser.java:117)
      	at com.liferay.dynamic.data.mapping.expression.internal.DDMExpressionImpl.<init>(DDMExpressionImpl.java:118)
      	at com.liferay.dynamic.data.mapping.expression.internal.DDMExpressionFactoryImpl.createExpression(DDMExpressionFactoryImpl.java:38)
      	at com.liferay.dynamic.data.mapping.form.builder.internal.converter.DDMFormRuleConverterImpl.createExpression(DDMFormRuleConverterImpl.java:272)
      	at com.liferay.dynamic.data.mapping.form.builder.internal.converter.DDMFormRuleConverterImpl.setSPIDDMFormRuleConditions(DDMFormRuleConverterImpl.java:319)
      	at com.liferay.dynamic.data.mapping.form.builder.internal.converter.DDMFormRuleConverterImpl.convertRule(DDMFormRuleConverterImpl.java:224)
      	at com.liferay.dynamic.data.mapping.form.builder.internal.converter.DDMFormRuleConverterImpl.convert(DDMFormRuleConverterImpl.java:60)
      	at com.liferay.dynamic.data.mapping.form.builder.internal.settings.DDMFormBuilderSettingsRetrieverHelperImpl.getSerializedDDMFormRules(DDMFormBuilderSettingsRetrieverHelperImpl.java:166)
      	at com.liferay.dynamic.data.mapping.form.builder.internal.settings.DDMFormBuilderSettingsRetrieverImpl.getSettings(DDMFormBuilderSettingsRetrieverImpl.java:77)
      	at com.liferay.dynamic.data.mapping.form.web.internal.display.context.DDMFormAdminDisplayContext.getDDMFormBuilderSettingsResponse(DDMFormAdminDisplayContext.java:1250)
      	at com.liferay.dynamic.data.mapping.form.web.internal.display.context.DDMFormAdminDisplayContext.getDataProviderInstanceParameterSettingsURL(DDMFormAdminDisplayContext.java:272)
      	at org.apache.jsp.admin.edit_005fform_005finstance_jsp._jspService(edit_005fform_005finstance_jsp.java:302)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
      	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
      	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
      

      7.2.x: Upgrade fails with the following message:

      2020-10-08 16:54:36.767 ERROR [main][UpgradeDDMStructure:97] Unable to upgrade the visibility expression "contains(getValue('getValue('text')'),"show")getValue('||')equals(getValue('getValue('text')'),"appear")" to a form rule
      

      Expected result:
      Upgrade finishes successfully and expression still works as before.

      Notes:

      1. The reason why master and 7.3.x have results different than earlier versions is LPS-106415;
      2. 7.1.x has potential to reproduce the error once LPS-109805 gets backported.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cleyton.magalhaes Cleyton Magalhaes (Inactive)
              Reporter:
              rodrigo.paulino Rodrigo Paulino
              Participants of an Issue:
              Recent user:
              Yunlin "Steven" Sun
              Engineering Assignee:
              Rodrigo Paulino
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                20 weeks, 1 day ago

                  Packages

                  Version Package
                  7.2.10 DXP FP11
                  7.2.10.3 DXP SP4
                  7.2.X
                  7.3.X
                  7.3.10 DXP FP1
                  7.3.10.1 DXP SP1
                  7.3.6 CE GA7
                  Master