enonic / app-contentstudio

Content Studio of Enonic XP
GNU General Public License v3.0
10 stars 4 forks source link

Checkboxes inside an option-set must be reset to default values after selected option was reset #2929

Closed sgauruseu closed 3 years ago

sgauruseu commented 3 years ago
  1. Create new content
  2. Fill out display name
  3. Select option "Text block"
  4. Check off both "Full width" and "Sidebar image" in the inner option-set
  5. Select some image inside the "Sidebar image" form

image

  1. Click on Reset, confirm and save this content. image

  2. Select option "Text block" again

image

BUG: Both checkboxes are selected and styles is not original.

Expected - checkboxes should be unselected

The similar issue with attachments in the option set. Attachments are not cleared after resetting the option image

Content type:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<content-type xmlns="urn:enonic:xp:model:1.0">
  <display-name>OptionSet</display-name>
  <super-type>base:structured</super-type>
  <form>
    <option-set name="radioOptionSet">
      <label>Single selection</label>
      <occurrences minimum="1" maximum="1"/>
      <options minimum="1" maximum="1">
        <option name="ctbText">
          <label i18n="ct.article.ctbText">Text block</label>
          <items>
            <input name="content" type="TextLine">
              <label>Content</label>
              <occurrences minimum="0" maximum="1"/>
            </input>
            <option-set name="ctbSettings">
              <label>Settings for content block</label>
              <occurrences minimum="1" maximum="1"/>
              <options minimum="0" maximum="10">

                <!-- Full Width -->
                <option name="fullWidth">
                  <label>Full width</label>
                </option>

                <!-- Sidebar image -->
                <option name="sidebarImage">
                  <label>Sidebar image</label>
                  <items>
                    <input name="image" type="ImageSelector">
                      <label>Image</label>
                      <occurrences minimum="1" maximum="1"/>
                      <config>
                        <allowPath>${site}/*</allowPath>
                      </config>
                    </input>
                    <input name="caption" type="TextLine">
                      <label>Caption</label>
                      <occurrences minimum="0" maximum="1"/>
                    </input>
                  </items>
                </option>
              </options>
            </option-set>
          </items>
        </option>
        <option name="ctbImages">
          <label>Images</label>
          <items>
            <option-set name="ctbSettings">
              <label>Settings for content block</label>
              <occurrences minimum="1" maximum="1"/>
              <options minimum="0" maximum="10">
                <!-- Full Width -->
                <option name="fullWidth">
                  <label>Full width</label>
                </option>
              </options>
            </option-set>
          </items>
        </option>
      </options>
    </option-set>
  </form>
</content-type>
alansemenov commented 3 years ago

@sgauruseu can you check if this has been fixed by the latest changes?

sgauruseu commented 3 years ago

The first case is still reproducing, but there are no problems with the clearing of attachments

ashklianko commented 3 years ago

Will be fixed in https://github.com/enonic/lib-admin-ui/pull/1890

ashklianko commented 3 years ago

Issue moved to enonic/lib-admin-ui #1901 via ZenHub