Bug with required fields inside optional item-set

Enonic version: 6.3.0

I have the following part in my site config:

    <item-set name="important-message">
        <label>Important message</label>
        <occurrences minimum="0" maximum="1"/>
            <input name="text" type="TextLine">
                <occurrences minimum="1" maximum="1"/>
            <!-- Other not-required fields -->
    <!-- Other config -->

As you might notice, the <item-set /> occurrence count is set to optional (minimum="0" maximum="1"), while the text input is set to required. The way I assumes this should work is that I might or might not have an important-message, but if I have one, I must have a message specified.

It saves when I remove the important-message, and everything looks great - but once I reload the admin page, the application box for the site turns red (because the site config is invalid). I open it up, and there’s an empty important-message there.

A temporary fix is to make every field optional and change my validation logic - but I would rather you fix the issue.

1 Like

Sounds like a bug indeed. We’ll look into it asap.

The bug is fixed. The fix will be included in the upcoming version 6.4 of Enonic XP.

1 Like