enonic / lib-admin-ui

Enonic XP Administration UI.
GNU General Public License v3.0
5 stars 5 forks source link

Option Set - Incorrect radio button behavior in multi selection #1878

Closed ashklianko closed 3 years ago

ashklianko commented 3 years ago

@sgauruseu commented on Tue Mar 30 2021

Case 1

  1. Select Features and open new wizard for Option Set
  2. Unselect the Option 2 radio
  3. Click on Save button

image

BUG - Option 2 radio gets selected again after the saving.

  1. Click on Option 2 again - BUG - Option 2 remains selected and subheader is not correct now, option 2 is duplicated

image

Case 2 This case is reproducing when Option 2 contains occurrences of htmlArea inputs, for example

  <option name="option_2">
          <label>Option 2</label>
          <default>true</default>
          <items>
            <input name="htmlarea_2_4" type="HtmlArea">
              <label>HTML content 2:4</label>
              <occurrences minimum="2" maximum="4"/>
            </input>
          </items>
        </option>

Unselect the Option 2 and save the content

BUG- 500 error appears after saving the content

image

5:05:34.323 ERROR c.e.x.j.i.e.JsonExceptionMapper - NullPointerException
java.lang.NullPointerException: null
        at com.enonic.xp.core.impl.content.validate.OccurrenceValidator.validateInputOccurrences(OccurrenceValidator.java:160)
        at com.enonic.xp.core.impl.content.validate.OccurrenceValidator.validateInput(OccurrenceValidator.java:76)
        at com.enonic.xp.core.impl.content.validate.OccurrenceValidator.validate(OccurrenceValidator.java:57)
        at com.enonic.xp.core.impl.content.validate.OccurrenceValidator.validateFormOptionSetSelection(OccurrenceValidator.java:114)
        at com.enonic.xp.core.impl.content.validate.OccurrenceValidator.validateFormOptionSet(OccurrenceValidator.java:8
alansemenov commented 3 years ago

Made a separate issue for the 2nd case: https://github.com/enonic/xp/issues/8726