Closed espen42 closed 3 years ago
First seen in app-superhero-blog when adding lib-menu. Reproduced by @poi33 in the enonic.com app.
There are multiple x-data elements allowed according to schema:
<xs:complexType name="site">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="x-data" type="xdata"/>
<xs:element minOccurs="0" name="form" type="form"/>
<xs:element minOccurs="0" name="processors" type="processors"/>
<xs:element minOccurs="0" name="mappings" type="mappings"/>
</xs:sequence>
</xs:complexType>
And as soon as you are done specifying x-data elements you may specify form.
This is how things are. If documentation suggests different, let's fix the documentation.
Using
xmlns="urn:enonic:xp:model:1.0"
inside the<site ...>
opening element in site.xml enforces the order of the x-data element(s) within, it seems to only work if placed before<form>
. This conflicts with recommendations in other docs.For example (collapsed code content for clarity, in the
<form>
and<mappings
> elements):...works, while... ...does not.
If the
xmlns
part is removed, the order doesn't cause any IDE warning or runtime error.This is not just a linting thing. When marked red as above, it builds just fine, but then, when editing the site in Content Studio, a wild runtime error appears: