Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Hippo CMS 7.7.7
Content Blocks 1.08.02
Description
I have a small issue with the Content Blocks addon. The use case
is as follows:
I have two compound types, let's call them A and B.
In a document type, I have a "content blocks" field that allows the
user to add either an A or a B. This works well.
The content blocks field has required set to true, and maxitems=1.
'Required' works in that a newly created document can't be saved until
either A or B has been added.
'Maxitems=1' works in that once either an A or a B has been added,
it's not possible to add more.
However, once an A or a B has been added, it can't be removed: the
usual 'X' icon is not displayed. This means the user can't remove e.g.
an A and replace it with a B.
Setting required to false on the content blocks field brings back the
'X' but obviously now the user can save without any A or B added.
This looks like a bug: I see no reason not to have the 'X' (remove
item) option when the field is required. Instead, the validation of
the document should fail on saving if there are 0 items in the content
blocks field.