[MGNLFORM-48] Form field 'selection': default value is not used -> null is passed to the freemarker Created: 10/Jun/10  Updated: 19/Jan/11  Resolved: 13/Jan/11

Status: Closed
Project: Magnolia Form Module
Component/s: None
Affects Version/s: 1.1.1
Fix Version/s: 1.2.1

Type: Bug Priority: Major
Reporter: Christian Ringele Assignee: Federico Grilli
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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
Date of First Response:

 Description   

When adding a 'selection' field, and defining a label:value, the value is passed to the template if the checkbox is checked.
If not checked, the defined default value should be passed. But 'null' is passed to the freemaker instead.



 Comments   
Comment by Zdenek Skodik [ 18/Jun/10 ]

Actually the intention behind the default value is that that value (one concrete option of the whole list you can select from) will be selected primarily and by default when the form field will be rendered.
So it's not for the case when any value is not selected. The "null handling" is treated ok in the paragraph script so personally I don't consider this as bug.
Christian?

Comment by Federico Grilli [ 13/Jan/11 ]

I think the current behavior is correct: no choice -> null value, unless the field is mandatory. Default value is correctly used only when rendering the control, to set its initial value (maybe "default value" is actually a misleading name and "initial value" would fit better).

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