[MGNLFORM-331] Form component does not work in 6.2.3 Created: 24/Sep/20  Updated: 22/Sep/21  Resolved: 07/Oct/20

Status: Closed
Project: Magnolia Form Module
Component/s: None
Affects Version/s: 2.7
Fix Version/s: 2.7.1

Type: Bug Priority: Neutral
Reporter: Viet Nguyen Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 2
Labels: 623, cs-bk, maintenance
Remaining Estimate: Not Specified
Time Spent: 0.5h
Original Estimate: Not Specified

Attachments: PNG File image-2020-10-06-18-28-55-415.png     PNG File image-2020-10-06-18-31-00-501.png     PNG File image-2020-10-06-18-32-02-806.png     PNG File image-2020-10-06-18-41-57-979.png    
Issue Links:
causality
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Testcase included:
Yes
Date of First Response:
Epic Link: UI framework implementation
Sprint: Maintenance 28
Story Points: 5

 Description   

Steps to reproduce
Configure a form component for any area such as:

areas:
  footer:
    availableComponents:
      form:
        id: form:components/form

Open the contact page in the travel demo and try to edit and save the contact form in the main area.

Expected results
Editor can use form component for their page.

Actual results
Null pointer

Caused by: info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: commit
	at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:64) ~[magnolia-ui-api-6.2.3.jar:?]
	at info.magnolia.ui.dialog.ActionExecution.execute(ActionExecution.java:73) ~[magnolia-ui-framework-6.2.3.jar:?]
	at info.magnolia.ui.dialog.ActionButton.lambda$new$d31ec881$1(ActionButton.java:65) ~[magnolia-ui-framework-6.2.3.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:499) ~[vaadin-server-8.9.4.jar:8.9.4]
	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:273) ~[vaadin-server-8.9.4.jar:8.9.4]
	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:237) ~[vaadin-server-8.9.4.jar:8.9.4]
	at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1014) ~[vaadin-server-8.9.4.jar:8.9.4]
	at com.vaadin.ui.Button.fireClick(Button.java:384) ~[vaadin-server-8.9.4.jar:8.9.4]
	at com.vaadin.ui.Button$1.click(Button.java:57) ~[vaadin-server-8.9.4.jar:8.9.4]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:155) ~[vaadin-server-8.9.4.jar:8.9.4]
	... 94 more
Caused by: java.lang.NullPointerException
	at info.magnolia.ui.editor.FormView.lambda$validate$9(FormView.java:177) ~[magnolia-ui-framework-6.2.3.jar:?]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) ~[?:?]
	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1675) ~[?:?]

Workaround
Use the old Pages app

Development notes
Issue did not exist in 6.2.2



 Comments   
Comment by Simon Lutz [ 28/Sep/20 ]

MGNLFORM tickets part of 6.2.3: https://jira.magnolia-cms.com/projects/MGNLFORM/versions/23696

Comment by Joerg von Frantzius [ 06/Oct/20 ]

The reason is that childForm.vaidate() returns null:

With the Magnolia dx-core/magnolia-dx-core-demo-webapp running locally, editing http://localhost:8080/magnoliaAuthor/.magnolia/admincentral#app:pages-app:detail;/travel/contact:edit and clicking "Commit" here:

the particular childForm is a info.magnolia.module.form.fields.FormControlNameView , and it is now wonder that it does return null:

I guess it should return an empty List instead?

Comment by Joerg von Frantzius [ 06/Oct/20 ]

That's also what /magnolia-ui-framework/src/main/java/info/magnolia/ui/field/StaticFieldView.java does:

Comment by Joerg von Frantzius [ 07/Oct/20 ]

Hi Aleksandr, as you probably thought already, a more sustainable fix would be for info.magnolia.ui.editor.FormView.validate() to check the result of childForm.validate() for being null, in case other EditorView.validate() implementations behave the same.

Generated at Mon Feb 12 05:39:10 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.