0

After I changed to developer mode, I can't view the main page, and get the following exception (Magento 2.1.2)

Invalid XML in file x.com/app/code/Ves/ImageSlider/etc/widget.xml:
Element 'description': This element is not expected. Expected is ( value ).

The issue is labelled to be at this area of the xml file

<parameter name="autoplay_timeout" xsi:type="text" visible="true">
    <label translate="true">Autoplay Timeout</label>
    <depends><parameter name="autoplay" value="1" /></depends>
    <description translate="true"><![CDATA[Default: 3000]]></description>
    <value>3000</value>
</parameter>
<parameter name="autoplay_speed" xsi:type="text" visible="true">
    <label translate="true">Autoplay Speed</label>
    <depends><parameter name="autoplay" value="1" /></depends>
    <description translate="true"><![CDATA[Default: 800]]></description>
    <value>800</value>
</parameter>
4
  • What's the content of app/code/Ves/ImageSlider/etc/widget.xml ? Feb 10, 2017 at 12:13
  • Do you want me to post the file or just the part that is labelled as the problem?
    – Wat
    Feb 10, 2017 at 12:14
  • the file please Feb 10, 2017 at 12:18
  • unfortunately, I don't think I can share the file to avoid any issues with the developers of the theme, but the area with the issue is posted as an edit now, if that can be of any help
    – Wat
    Feb 10, 2017 at 12:23

1 Answer 1

3

move the description tag above the depends tag.
In the XSD schema Magento/Widget/etc/widget.xsd the parameter type is defined as this

 <xs:complexType name="parameterType" abstract="true">
    <xs:annotation>
        <xs:documentation>
            Abstract type which is parent of all parameters. Contains attributes
            and elements common across all parameter types.
        </xs:documentation>
    </xs:annotation>
    <xs:sequence>
        <xs:element name="label" type="translatableType" minOccurs="0" maxOccurs="1" />
        <xs:element name="description" type="translatableType" minOccurs="0" maxOccurs="1" />
        <xs:element name="depends" type="dependsType" minOccurs="0" maxOccurs="1" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
    <xs:attribute name="visible" type="xs:boolean" />
    <xs:attribute name="sort_order" type="xs:int" />
    <xs:attribute name="required" type="xs:string" />
</xs:complexType>

focus on this part

    <xs:sequence>
        <xs:element name="label" type="translatableType" minOccurs="0" maxOccurs="1" />
        <xs:element name="description" type="translatableType" minOccurs="0" maxOccurs="1" />
        <xs:element name="depends" type="dependsType" minOccurs="0" maxOccurs="1" />
     </xs:sequence>

This means that the element parameter supports the child elements listed in the sequence tag in this order. label, description, depends.

Side node: Ignore the fact that you don't see the value tag in here. This is added later in the same file depending on the value of the parameter type

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.