[MGNLFORM-303] FormSummaryParagraphModel tries to wrap node with I18nNodeWrapper twice and throws exception Created: 07/May/18  Updated: 18/Mar/21  Resolved: 16/Mar/21

Status: Closed
Project: Magnolia Form Module
Component/s: None
Affects Version/s: 2.4, 2.7.2
Fix Version/s: 2.5.6, 2.7.3

Type: Bug Priority: Neutral
Reporter: Evzen Fochr Assignee: Chuong Doan Huy
Resolution: Fixed Votes: 2
Labels: VN-Maintenance, maintenance
Remaining Estimate: Not Specified
Time Spent: 1d 1h
Original Estimate: Not Specified

Issue Links:
Relates
causality
caused by MGNLFORM-294 Remove uses of the Content API Closed
relation
is related to MGNLFORM-309 Summary (field) works incorrectly in ... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Sprint: Maintenance 48
Story Points: 1

 Description   

Reproduce:
Click trough book tour on travel demo and fill only required fields. While on summary step check consolle and you will see ftl error there.

Caused by:
createFormSummaryBean line 153 calls for field 01 findAndSetTemplateParameters. That wraps node with i18n wrapper and calls findAndSetComplexControlLabels on line 174. This method tries to wrap node again and that cause:
"java.lang.IllegalArgumentException: node /travel/book-tour/main/0/fieldsets/0/fields/01 is already decorated by class info.magnolia.jcr.wrapper.I18nContentDecorator"



 Comments   
Comment by Evzen Fochr [ 07/May/18 ]

Unlike ContentWrapper, ContentDecoratorNodeWrapper#setWrappedNode is checking and throws exception if node is already wrapped by same wrapper.

Comment by Marc Johnen [ 25/Mar/19 ]

Even when trying the current Magolia-Version, the summary does not work:

https://demopublic.magnolia-cms.com/book-tour/

Comment by Marc Johnen [ 26/Mar/19 ]

It's easy to fix. In info.magnolia.module.form.templates.components.FormSummaryParagraphModel.findAndSetTemplateParameters
(forms module version 2.4) move line 171 (Node i18nFieldNode = new I18nNodeWrapper(fieldNode) to 176 in the else if clause and use fieldNode instead of i18nFieldNode in the code before.

I just copied the class, fixed it and configured it as the modelClass for formSubmit and formSummary.

Comment by Federico Grilli [ 25/Nov/20 ]

juergenulrich thank you very much for your PR - maintenance team will review the code and possibly include it in a next Magnolia release asap.

Cheers,

Federico, for the Magnolia team

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