{"id":3374,"date":"2024-01-18T03:30:06","date_gmt":"2024-01-18T03:30:06","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solved-argument-passed-must-be-array-null-given-in-magento-2-admin-grid\/"},"modified":"2025-01-02T10:01:52","modified_gmt":"2025-01-02T10:01:52","slug":"solved-argument-passed-must-be-array-null-given-in-magento-2-admin-grid","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solved-argument-passed-must-be-array-null-given-in-magento-2-admin-grid\/","title":{"rendered":"Solved: Argument Passed Must Be Array, Null Given Error in Magento 2 Admin Grid"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this post, find possible reasons and a solution to the &#8220;Argument passed must be array, Null given&#8221; error in the Magento 2 custom order grid.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Recently, I was coding a <a href=\"https:\/\/meetanshi.com\/blog\/create-admin-grid-magento-2\/\" target=\"_blank\" rel=\"noopener\">custom order grid<\/a> for a Magento 2 customization project. Everything was going fine until my screen flashed with an error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It read: &#8220;Argument 2 passed to MagentoFrameworkViewElementUiComponentFactory::argumentsResolver() must be of the type array, null given.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It was unexpected. Annoying. And alarming.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The error appears clear enough that there is some UI component misconfiguration or issues with the data source setup. I investigated the matter further and found a solution that worked for me.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re also facing the &#8220;Argument passed must be array, Null given&#8221; error in Magento 2 while coding a custom grid, read this post till the end to find the solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Solve &#8220;Argument Passed Must Be Array, Null Given&#8221; Error in Magento 2?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following error:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Argument 2 passed to MagentoFrameworkViewElementUiComponentFactory::argumentsResolver()<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">means that a null value is passed to a function where an array is expected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It can appear while coding a custom admin grid.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generally, it occurs when there is a mismatch of the UiComponent name in the layout.xml.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The solution:<\/strong> Review the uiComponent in the layout.xml file and correct any typos or spelling mistakes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it. Problem solved? Show your cheers by rating this post with five stars.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And if you&#8217;re still facing any issues related to the &#8220;Argument Passed Must Be Array, Null Given&#8221; Error in Magento 2 Admin Grid, feel free to comment. I&#8217;ll be happy to help you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happy Coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, find possible reasons and a solution to the &#8220;Argument passed must be array, Null given&#8221; error in the Magento 2 custom order&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-3374","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=3374"}],"version-history":[{"count":1,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3374\/revisions"}],"predecessor-version":[{"id":5448,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3374\/revisions\/5448"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=3374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=3374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=3374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}