[MGNLFORM-322] Nested form misleading available fields for Freemarker syntax Created: 27/Jul/20  Updated: 30/Mar/21  Resolved: 25/Feb/21

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

Type: Bug Priority: Neutral
Reporter: Viet Nguyen Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
causality
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 45, Maintenance 46
Story Points: 5

 Description   

Steps to reproduce

Configure a project that have following pages structure:

- page A
   + page AA
   + page AB
   + page AC

Then use Forms Module and on each of these pages, so 4 forms configured. 

Expected results

I should see paremeters (freemarkerParams) only from form defined on page A. 

Actual results

In the form on page A, in Email and Confirmation E mail tabs, under field `freemarkerParams` -  I can see all of the parameters defined under all of these 4 forms.

Workaround

No

Development notes

Debug shown in info.magnolia.module.form.fields.factory.StaticFormFieldFactory#findAllFormControlNames I have root page as input param. And nodes are searched recursively inside that page. Instead of rootPage I think I should have form node, not page node. Thanks to that parameters will be searched only inside that particular form, not on the whole page. 

Example: 

  • In form A I have following fields: 'name', 'email', 'msg' and submitButton
  • In form AB I have: 'amount', 'subject', 'catName' and submitButton. 

On confirmation tab in form A I can see following parameters under freemarkerParams field: 'name', 'email', 'msg',  'amount', 'subject', 'catName'.

In your documentation under this field description we have: 

Available fields for Freemarker syntax Form field names that can be used in Freemarker tags.

And if in mail message in form A I will use parameter from form B (for example catName) -> there will be an exception.

Customer impact:

This bug has been reported by our client. They have one small contact form on rootPage. And they have another, very large (around 200+ fields) in one of the subnodes. And in this contact form on root page they can see all of the fields from this big form. 

This misleading causes content editors / authors creating emails with errors.



 Comments   
Comment by Viet Nguyen [ 05/Aug/20 ]

Hello mlesiak,

Please follow up here for any updates. We do not think it will make it into 6.2.3, hence 6.2.4 earliest depending on what other issues we find from now until then.

Hope this helps!

Comment by Marek Lesiak [ 16/Dec/20 ]

Any updates on that? Will the fix be available for version 6.1.x?

Comment by Simon Lutz [ 17/Dec/20 ]

Hi mlesiak, the fix is scheduled for one of the next 6.2 maintenance releases. As 6.1 is in extended end of life, we will not provide a bug fix on that branch.

Comment by Marek Lesiak [ 05/Feb/21 ]

Hi, was it released in 6.2.6 ? 

Comment by Mercedes Iruela [ 05/Feb/21 ]

Hello Marek,

Unfortunately, there were other bugs with higher priority, so we couldn't include it in 6.2.6. However, the goal is to have it included in 6.2.7.

Regards,
Mercedes

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