Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-7030

Switchable field creates empty contentNodes for non selected option

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Neutral Neutral
    • None
    • 6.2.16
    • None

      Steps to reproduce

      1.  Create a component as follows:
        form:
          properties:
            - name: text
              i18n: true
              required: true
              $type: textField
            - name: switchMe
              $type: switchableField
              i18n: true
              field:
                $type: radioButtonGroupField
                layout: horizontal
                defaultValue: internal
                datasource:
                  $type: optionListDatasource
                  options:
                    - name: internal
                      value: internal
                    - name: external
                      value: external
              itemProvider:
                $type: jcrChildNodeProvider
              forms:
                - name: internal
                  properties:
                    internal:
                      $type: pageLinkField
                - name: external
                  properties:
                    external:
                      $type: textField
      1.  Within a multi-language site, include the component in a page
      2. Open the component (default language, e.g, EN) and select something on the switchable
      3. Save the component, open it and check everything is as expected (value is checked)
      4. Switch to another language (e.g, DE) and check the radio button has no option selected (this is not true anymore, defaults works in all languages now)
      5. Fulfill the textfield and save the component
      6. Go to JCR, open the page which has this component, and check that a contentNode named switchMe_de has been created tho it has no properties.

      Expected results

      switchMe_de contentNode is created if it gets selected at the dialog

      Actual results

      switchMe_de contentNode is created even if it is not selected by the user

      Workaround

      N/A

      Development notes

      This is a problem as far as when the FTL is rendered and checks that the node exists, it will try to read the properties (on this case, it will try to read the attributes to generate the proper link) which will cause nullPointers and will break the template.

        Acceptance criteria

              rhayoun Rabie Hayoun
              ccantalapiedra Carlos Cantalapiedra
              Nucleus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD