Closed ComLock closed 6 years ago
Not a bug. Mixins are not allowed that deep. It needs to be included as imediate child to the config-node level.
That cannot be true. I believe I have included mixins on many levels before. And mixins within mixins and so on.
I forgot to mention this works fine in Content Studio.
The error appears when I try to use content.modify.
Then that was a mistake / pure luck. It has never been meant to work and should fail.
The doc doesn't say anything about it having to be root level.
http://xp.readthedocs.io/en/stable/developer/schema/mixins.html
@aro should we fix the docs to say that mixins must be on top level or should we fix content.modify
to work in this case?
I think the problem is that you use the same name for the field-set and the input at the top level of the mixin: "securityClassification".
A field-set is just a UI wrapper, it does not add a new level for the data inside (as opposed to item-set). So field-set should probably not have had a "name", but it does. And there is a conflict when an item inside the mixin has the same name of the field-set.
So basically, don't do that :) I think it's not a simple solution to fix without breaking other cases.
@ComLock can you try just renaming the field-set, since that name is not used for anything anyway?
<field-set name="securityClassification22"> <---
<label>Security classification</label>
<items>
<inline mixin="security-classification" />
</items>
</field-set>
Mixins are fine, can be nested, there is no problem with that.
@aro I will try changing the field-set name. This is not easy to spot though, as the name of the input is in a different file, namely the mixin file.
I have a contentType with this:
The mixin
When securityClassification is set to the default public
I get the error: java.lang.IllegalArgumentException: FormItem [] in [securityClassification] is not of type Input: com.enonic.xp.form.FieldSet