3

Note: This is not a duplicate of any similar error

I have found a strange bug in Magento 2. It shows the following error in the browser's console for only restricted admin user (the user which has not full rights of the admin panel).

Uncaught TypeError: Cannot read property 'items' of null
    at UiClass.onRequestComplete (data-storage.js:270)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at done (jquery.js:9840)
    at XMLHttpRequest.callback (jquery.js:10311)

Console Error

To replicate the issue, follow the process below:

  • Login to the backend with a user with full backend permission.
  • Create a new user role from System >> User Roles with Custom Resource Access. For example, select only the Dashboard from the resources list. (You can choose any other)

Create role

  • After creating the role, create a new admin user with the role which you created in the previous step.
  • Login to the backend with new user's login credentials in another browser or after logging out the current user.
  • Open the browser's console and check the error mentioned above.

Note: I have noticed the same error from Magento versions 2.2.4 to 2.2.7.

8
  • hi @Mohit, did you get the solution for this issue? I am also facing the same May 6 '19 at 11:45
  • No @jafar-pinjar, not yet. May 7 '19 at 4:29
  • hi @Mohit, any temporary fix u did? or any suggestions to avoid this May 7 '19 at 6:12
  • have you installed any custom modules related to orders? May 7 '19 at 6:56
  • No, actually my question is not related to orders. I am having this error on every page in the backend for any restricted user. May 7 '19 at 6:59
0

after adding resource 'Basic Configuration Section' under 'Stores->Settings->Configuration', My local loaded fine.

enter image description here

2
  • Thanks, @jonas-chen for sharing the solution. Aug 27 '19 at 4:42
  • Did you resolve the issue ? Oct 21 '20 at 5:42
0

This may not be issue for new Magento version but M2.x and M3.X has issue: change data source format to below:

<dataSource name="listing_data_source"> <argument name="dataProvider" xsi:type="configurableObject"> <argument name="class" xsi:type="string">Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider</argument> <argument name="name" xsi:type="string">listing_data_source</argument> <argument name="primaryFieldName" xsi:type="string">id</argument> <argument name="requestFieldName" xsi:type="string">id</argument> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="storageConfig" xsi:type="array"> <item name="indexField" xsi:type="string">id</item> </item> <item name="update_url" xsi:type="url" path="mui/index/render"/> </item> </argument> </argument> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item> </item> </argument> </dataSource>

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.