Empty items in item-set won't delete

Enonic version: 7.14.2
Content Studio: 5.1.4


When setting up a item-set, we’re unable to delete items where all fields are empty.

Steps to reproduce:

  1. Create a part with an item-set containing a TextLine-field.
  2. Add the part to a page and add a few items (the amount doesn’t seem to matter) with text in each field.
  3. In one of the added items, remove the text in the TextLine-field.
  4. Click “Apply”
  5. Refresh the page.
  6. Attempt to delete the item with the empty text field
  7. Click “Mark as ready”
  8. The item re-appears.

It seems that Content Studio or Enonic compares the data in the entire set when deleting. When all contents inside the item is empty, deletion of the item isn’t going through.

Workaround:

  1. Fill the TextLine-field with some temporary text.
  2. Click “Apply” and “Mark as ready”
  3. The item can now be deleted as normal.

This is not a big issue, but it’s a bit annoying for the editors when realise they added one item to many and just wanting to delete the extra item.

Hello

Please provide the XML schema you are using.

Ah, should have done that to begin with:

<part xmlns="urn:enonic:xp:model:1.0">
    <display-name>Trekkspill</display-name>
    <form>
        <item-set name="accordion">
            <label>Trekkspill</label>
            <occurrences minimum="2" maximum="0"/>
            <items>
                <input name="title" type="TextLine">
                    <label>Tittel</label>
                    <occurrences minimum="1" maximum="1"/>
                </input>
                <input name="anchorId" type="TextLine">
                    <label>Ankerid</label>
                    <help-text>Setter inn anker-id som kan legges til etter selve url'en.</help-text>
                    <occurrences minimum="0" maximum="1"/>
                </input>
                <input name="html" type="HtmlArea">
                    <label>Innhold</label>
                    <occurrences minimum="1" maximum="1"/>
                </input>
            </items>
        </item-set>
    </form>
</part>

Thanks for reporting this.

We’ve reproduced the bug and registered it here. Hoping to fix this for the next release of Content Studio.

1 Like

Super! Not a big issue - we do have a workaround for now by adding faux data, saving and then deleting the item again. Just an annoyance really. Thanks for following up!