Details
-
Bug
-
Resolution: Unresolved
-
Neutral
-
None
-
2.7.8
-
None
-
None
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.
- Going from an Input field to a Selection field

- Going from a Number or date field to a Selection field

Reproduce
- Open the page /travel/contact for editing.
- Scroll down the page to the form. Bring focus to the "Form Fields".
- Click on one of the Input fields.
- From the actionbar, click "Change Template".
- Choose a Selection field and click next.
- Observe the error --> error-log.txt

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
I should be able to change template without breaking the form.
Actual
Form enters an unusable state. Cannot recover from the page editor.
Workaround
Use the JCR Browser to fix the form.
Checklists
Acceptance criteria