Bug in Liferay's form functionality makes impossible to create forms with more than 28 items

Viewed 45

There is a bug in the Liferay's forms functionality (I'm using Liferay CE 7.4.32) that makes impossible to have forms with more than 28 items.

The form only reaches 28 questions before being unable to save new items and triggering the error, as if there was some limit to the number of items that could be added to the form. I also created a completely new form and got the same error when the form reached the same state as the original one:

2022-09-05 11:31:24.685 ERROR [http-nio-8080-exec-1][PortletServlet:117] null
javax.portlet.PortletException: java.lang.IllegalStateException: The property "serializedFormContext" is required
    at com.liferay.portal.kernel.portlet.bridges.mvc.BaseTransactionalMVCActionCommand.processAction(BaseTransactionalMVCActionCommand.java:58) ~[portal-kernel.jar:?]
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:402) ~[portal-kernel.jar:?]
    at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:82) ~[portal-kernel.jar:?]
    at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:256) ~[portal-kernel.jar:?]
    at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77) ~[portal-impl.jar:?]
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:50) ~[portal-kernel.jar:?]
    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:113) ~[portal-kernel.jar:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[servlet-api.jar:4.0.FR]
    at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153) ~[?:?]
    at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62) ~[?:?]
    at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120) ~[?:?]
    at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48) ~[?:?]
....
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]
Caused by: java.lang.IllegalStateException: The property "serializedFormContext" is required
    at com.liferay.dynamic.data.mapping.form.builder.internal.context.DDMFormContextToDDMForm.deserialize(DDMFormContextToDDMForm.java:77) ~[?:?]
    at com.liferay.dynamic.data.mapping.form.builder.internal.context.DDMFormContextToDDMForm.deserialize(DDMFormContextToDDMForm.java:59) ~[?:?]
    at com.liferay.dynamic.data.mapping.form.web.internal.portlet.action.helper.SaveFormInstanceMVCCommandHelper._getDDMForm(SaveFormInstanceMVCCommandHelper.java:222) ~[bundleFile:?]
    at com.liferay.dynamic.data.mapping.form.web.internal.portlet.action.helper.SaveFormInstanceMVCCommandHelper._updateFormInstance(SaveFormInstanceMVCCommandHelper.java:340) ~[bundleFile:?]
    at com.liferay.dynamic.data.mapping.form.web.internal.portlet.action.helper.SaveFormInstanceMVCCommandHelper.saveFormInstance(SaveFormInstanceMVCCommandHelper.java:125) ~[bundleFile:?]
    at com.liferay.dynamic.data.mapping.form.web.internal.portlet.action.SaveFormInstanceMVCActionCommand.doService(SaveFormInstanceMVCActionCommand.java:57) ~[bundleFile:?]
    at com.liferay.dynamic.data.mapping.form.web.internal.portlet.action.SaveFormInstanceMVCActionCommand.doTransactionalCommand(SaveFormInstanceMVCActionCommand.java:84) ~[bundleFile:?]
    at com.liferay.portal.kernel.portlet.bridges.mvc.BaseTransactionalMVCActionCommand$1.call(BaseTransactionalMVCActionCommand.java:44) ~[portal-kernel.jar:?]
    at com.liferay.portal.kernel.portlet.bridges.mvc.BaseTransactionalMVCActionCommand$1.call(BaseTransactionalMVCActionCommand.java:40) ~[portal-kernel.jar:?]
    at com.liferay.portal.spring.transaction.BaseTransactionExecutor.execute(BaseTransactionExecutor.java:37) ~[portal-impl.jar:?]
    at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39) ~[portal-impl.jar:?]
    at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28) ~[portal-kernel.jar:?]

When the form reaches this "maximum", if you keep adding questions to the form, the next time you try to save it, Liferay automatically redirects you to the listing of available forms and all your work is lost.

Does someone know a fix or a workaround for this issue? Any help would be much appreciated.

1 Answers

Leaving this here just in case it is useful for someone in the future. As indicated by Olaf, there is an Liferay issue open about this problem: https://issues.liferay.com/browse/LPS-156559

In this ticket, there is a workaround mentioned, which is changing the property com.liferay.portal.kernel.upload.FileItem.threshold.size=8048576

I confirm that I tested the workaround and it worked for me

Related