Skip to content

Problema com di.xml na versão 2.2.0 #1

Description

@marcoaacoliveira

Instalando o módulo no Magento 2.2.0 encontrei o seguinte erro:

Invalid Document
Element 'type', attribute 'type': The attribute 'type' is not allowed.
Line: 10

O problema estava no etc/di.xml:

    <type name="Intelipost\Quote\Model\Resource\Shipment\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">intelipost_shipment</argument>
            <argument name="eventPrefix" xsi:type="string">intelipost_quote_grid_collection</argument>
        	<argument name="eventObject" xsi:type="string">intelipost_grid_collection</argument>
            <argument name="resourceModel" xsi:type="string">Intelipost\Quote\Model\Resource\Shipment</argument>
        </arguments>
    </type>

O nó type não tem atributo type, segundo o config.xsd:

                <xs:element name="type" type="typeType" minOccurs="0" maxOccurs="unbounded">
                    <xs:unique name="uniqueTypeParam">
                        <xs:annotation>
                            <xs:documentation>
                                Param name should be unique in scope of type
                            </xs:documentation>
                        </xs:annotation>
                        <xs:selector xpath="param" />
                        <xs:field xpath="@name" />
                    </xs:unique>
                </xs:element>

Uma sugestão (que aparentemente funcionou aqui) é colocar em nó separado:

    <preference for="Intelipost\Quote\Model\Resource\Shipment\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult" />
    <type name="Intelipost\Quote\Model\Resource\Shipment\Grid\Collection">
        <arguments>
            <argument name="mainTable" xsi:type="string">intelipost_shipment</argument>
            <argument name="eventPrefix" xsi:type="string">intelipost_quote_grid_collection</argument>
        	<argument name="eventObject" xsi:type="string">intelipost_grid_collection</argument>
            <argument name="resourceModel" xsi:type="string">Intelipost\Quote\Model\Resource\Shipment</argument>
        </arguments>
    </type>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions