When I want to add a composition to a parent DocType which already has child DocTypes, I cannot add a composition. I get the message:
This content type is used in a composition, and therefore cannot be
composed itself.
When I add the composition to the parent DocType prior to adding child DocTypes, it works. Child DocTypes added to the parent later properly inherit the parent's compositions.
This seems to be a rather odd limitation / behavior, and an old one for that. See this issue for Umbraco 7 from 2015 (still open), or this forum thread from 2017 (without solution).
Is there a way to get around this strange behavior?
Can't add composition to DocType which has children
When I want to add a composition to a parent DocType which already has child DocTypes, I cannot add a composition. I get the message:
When I add the composition to the parent DocType prior to adding child DocTypes, it works. Child DocTypes added to the parent later properly inherit the parent's compositions.
This seems to be a rather odd limitation / behavior, and an old one for that. See this issue for Umbraco 7 from 2015 (still open), or this forum thread from 2017 (without solution).
Is there a way to get around this strange behavior?
Hi Mikael,
If I'm correct this issue happens to avoid circular references in the classes generated by ModelsBuilder. So it is intentional.
Yes, the behavior is intentional, see this reply from Sebastiaan Janssen.
is working on a reply...