Uploaded image for project: 'Magnolia Form Module'
  1. Magnolia Form Module
  2. MGNLFORM-394

Change template can lead to a broken form

    XMLWordPrintable

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

      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

        Attachments

          Activity

            People

              Unassigned Unassigned
              rgange Richard Gange
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD