[MGNLFORM-394] Change template can lead to a broken form Created: 13/Sep/23 Updated: 14/Sep/23 |
|
| Status: | Open |
| Project: | Magnolia Form Module |
| Component/s: | None |
| Affects Version/s: | 2.7.8 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Richard Gange | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| 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
|
||||
| Epic Link: | AuthorX Support | ||||
| Team: | |||||
| Description |
|
There are some cases when using the change template button where the form can become completely broken. A couple of cases are when switching fields.
Reproduce
Error while rendering [/travel/contact/main/01/fieldsets/formGroupFields/fields/email] with template [form:components/formSelection] for URI [/travel/contact.html?mgnlPreview=false&mgnlChannel=desktop]:
RenderException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> content.horizontal [in template "form/components/formSelection.ftl" at line 26, column 17]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${content.horizontal?string('class="m... [in template "form/components/formSelection.ftl" at line 26, column 15]
----
Expected Actual Workaround |