Skip to content

Commit 56c7609

Browse files
committed
Add FileUploader form element XSD definition
I'm not sure if the solution proposed in this commit is correct, but I couldn't figure out any more logical way to deal with the validation errors on the Travis CI build. The error follows: 1) Magento\Test\Integrity\Xml\SchemaTest::testXmlFiles Passed: 1881, Failed: 6, Incomplete: 0, Skipped: 0. Data set: /app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml Error validating /home/travis/build/magento/magento2/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml against urn:magento:module:Magento_Ui:etc/ui_configuration.xsd Array ( [0] => Element 'fileUploader': This element is not expected. Expected is one of ( hidden, file, input, date, boolean, checkbox, checkboxset, email, select, multiselect ). Line: 168 [1] => Element 'wysiwyg', attribute 'class': The attribute 'class' is not allowed. Line: 206 ) Failed asserting that an array is empty. Element zero in that array is what I am attempting to fix here.
1 parent b32a33a commit 56c7609

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

app/code/Magento/Ui/etc/ui_configuration.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
<xs:element name="price" type="formElementPrice" maxOccurs="unbounded"/>
227227
<xs:element name="radioset" type="formElementRadioset" maxOccurs="unbounded"/>
228228
<xs:element name="wysiwyg" type="formElementWysiwyg" maxOccurs="unbounded"/>
229+
<xs:element name="fileUploader" type="formElementFileUploader" maxOccurs="unbounded"/>
229230
</xs:choice>
230231
</xs:group>
231232

app/code/Magento/Ui/view/base/ui_component/etc/definition/fileUploader.xsd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@
2323
<xs:attributeGroup ref="ui_element_attributes"/>
2424
</xs:complexType>
2525

26+
<xs:complexType name="formElementFileUploader">
27+
<xs:sequence>
28+
<xs:element name="settings" minOccurs="0" maxOccurs="1">
29+
<xs:complexType>
30+
<xs:choice minOccurs="0" maxOccurs="unbounded">
31+
<xs:group ref="componentFileUploaderSettings"/>
32+
</xs:choice>
33+
</xs:complexType>
34+
</xs:element>
35+
</xs:sequence>
36+
<xs:attributeGroup ref="ui_element_attributes"/>
37+
</xs:complexType>
38+
2639
<xs:group name="componentFileUploaderSettings">
2740
<xs:choice>
2841
<xs:group ref="abstractSettings"/>

0 commit comments

Comments
 (0)