5

I have "mass change attribute set" extension with Magento 2.3.3. All works with Magento 2.3.2 but now is issue with magento 2.3.3. How i can fix this error?

Class argument is invalid: developer_name\ChangeAttributeSet\Ui\Component\MassAction\Group\Options

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Ui/etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
    <massaction name="listing_massaction">
        <action name="changeattributeset">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">changeattributeset</item>
                    <item name="label" xsi:type="string" translate="true">Change attribute set</item>
                </item>
            </argument>
            <argument name="actions" xsi:type="configurableObject">
                <argument name="class" xsi:type="string">developer_name\ChangeAttributeSet\Ui\Component\MassAction\Group\Options</argument>
                <argument name="data" xsi:type="array">
                    <item name="urlPath" xsi:type="string">changeattributeset/product/massChangeattributeset</item>
                    <item name="paramName" xsi:type="string">changeattributeset</item>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Change attribute set</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure to assign selected products to new attribute set?</item>
                    </item>
                </argument>             
            </argument>
        </action>
    </massaction>
</listingToolbar>

2

update your xml to

<?xml version="1.0"?>
 <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
    <massaction name="listing_massaction">
        <action name="changeattributeset">
            <settings>
                <type>changeattributeset</type>
                <label translate="true">Change attribute set</label>
                <actions class="developer_name\ChangeAttributeSet\Ui\Component\MassAction\Group\Options"/>
            </settings>
        </action>
    </massaction>
</listingToolbar>

Then in di.xml

developer_name\ChangeAttributeSet\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="developer_name\ChangeAttributeSet\Ui\Component\MassAction\Group\Options">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="urlPath" xsi:type="string">changeattributeset/product/massChangeattributeset</item>
                <item name="paramName" xsi:type="string">changeattributeset</item>
                <item name="confirm" xsi:type="array">
                    <item name="title" xsi:type="string" translatable="true">Change attribute set</item>
                    <item name="message" xsi:type="string" translatable="true">Are you sure to assign selected products to new attribute set?</item>
                </item>
            </argument>
        </arguments>
    </type>
</config>
| improve this answer | |
0

It looks like your class in the configurableObject needs to extend \Magento\Ui\DataProvider\AbstractDataProvider in order to be valid.

Kind regards,

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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