cancel
Showing results for 
Search instead for 
Did you mean: 

Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Can anyone please help me. I have just installed magento 2.3.2 and getting this error on admin section. 

 

I am in developer mode on community edition 

 

Please help!!!!!!!!

 

 

1 exception(s):
Exception #0 (InvalidArgumentException): Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

 

8 REPLIES 8

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Hi @gurpreetrajpal 

This error belongs to declaration of datasource within ui component xml file of module.
Kindly refer below link and try to resolve this.
https://devdocs.magento.com/guides/v2.4/ui_comp_guide/concepts/ui_comp_data_source.html

It may help you to resolve issue.

Problem solved? Click Accept as Solution!

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

@Bhanu Periwal Thanks for the reply but now it is showing the below error.

 

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): The XML in file "/home/souqare1/public_html/magento/app/code/Magento/AdminNotification/view/adminhtml/ui_component/notification_area.xml" is invalid:
Element 'argument': This element is not expected.
Line: 32

When i change my notification component to this

 

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">notification_area.notification_area_data_source</item>
</item>
</argument>
<settings>
<spinner>columns</spinner>
<deps>
<dep>notification_area.notification_area_data_source</dep>
</deps>
</settings>
<dataSource name="notification_area_data_source" component="Magento_Ui/js/grid/provider">
<settings>
<storageConfig>
<param name="indexField" xsi:type="string">identity</param>
</storageConfig>
<updateUrl path="mui/index/render"/>
</settings>
<dataProvider class="Magento\AdminNotification\Ui\Component\DataProvider\DataProvider" name="notification_area_data_source">
<settings>
<requestFieldName>identity</requestFieldName>
<primaryFieldName>identity</primaryFieldName>
</settings>
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">Magento\AdminNotification\Ui\Component\DataProvider\DataProvider</argument>
<argument name="name" xsi:type="string">notification_area_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">entity_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
</argument>
</dataProvider>

</dataSource>
<columns name="columns" component="Magento_AdminNotification/js/grid/listing" template="Magento_AdminNotification/grid/listing">
<column name="created_at" component="Magento_AdminNotification/js/grid/columns/message" sortOrder="30">
<settings>
<dataType>text</dataType>
<label translate="true"/>
<sorting>asc</sorting>
</settings>
</column>
</columns>
</listing>

 

 

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Hi @gurpreetrajpal 

Kindly refer below link for your issue:
https://magento.stackexchange.com/questions/217172/how-do-i-fix-this-error-element-reference-this-el...

If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Thanks for it but can you please tell me which version of magento works perfect without errors?

 

I have installed and checked 2.3.2 and 2.3.5 but none of them installed and worked without errors. 

 

I am stuck with this for last 10 days.

 

Please advise me which verison i should install and which verison is error free version.

 

Thanks

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Rename vendor folder and run composer update. It solver 99% problems

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

Thanks for the update and quick reply. I'll be sure to keep an eye on this thread IndigoCard

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

just add to app/etc/di.xml

 <type name="Magento\Framework\View\Element\UiComponent\Argument\Interpreter\ConfigurableObject">
        <arguments>
            <argument name="classWhitelist" xsi:type="array">
                <item name="0" xsi:type="string">Magento\Framework\Data\OptionSourceInterface</item>
                <item name="1" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface</item>
                <item name="2" xsi:type="string">Magento\Framework\View\Element\UiComponent\ContextInterface</item>
            </argument>
        </arguments>
    </type>

 

Re: Class argument is invalid: Magento\AdminNotification\Ui\Component\DataProvider\DataProvider

thank you guys for such a piece of valuable information click here to check if I implemented it right?