Issue
-
An exception is thrown when some form field rule is empty or incorrect and the user tries to save the form.
Steps to reproduce:
- Add a new form with three text fields: A, B, C
- Add a new rule for this form using the fields: if A equals B, show C
- Save the form.
- Edit the form and delete field A.
- The recently created rule is now inconsistent: A does not exist anymore.
- Publish the form.
Observed Behavior: the below exceptions can be observed on the console.
03-Jun-2021 06:58:51.558 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [621,752] milliseconds
2021-06-03 07:11:46.466 ERROR [http-nio-8080-exec-10][PortletServlet:119] javax.portlet.PortletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Lcom.liferay.dynamic.data.mapping.form.builder.internal.converter.model.DDMFormRuleCondition;
javax.portlet.PortletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Lcom.liferay.dynamic.data.mapping.form.builder.internal.converter.model.DDMFormRuleCondition;
at com.liferay.portal.kernel.portlet.bridges.mvc.BaseTransactionalMVCActionCommand.processAction(BaseTransactionalMVCActionCommand.java:59)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:378)
at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:88)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:260)
at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77)Expected Behavior: a more specific error message should be shown in the UI: "ERROR: There are invalid rule expressions."
Environment
- Liferay DXP 7.2
Resolution
- It's a known issue and is fixed by LPS-118102
- Since the code has been considerably changed, this might be fixed in the upcoming fixpack. However, If the hotfix is required for this issue, please create a support ticket requesting hotfix by attaching patch details.
- Installing Fix Packs and Hotfixes on Liferay DXP will guide to install this hotfix in the respective environment.
Additional Information
- For 7.2, the fix can be tracked here LPS-127795