New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product grid is not getting displayed, getting undefined array key "name" in logs. #35783
Comments
Hi @malikt. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
After debugging a little bit, I have fixed the Grid issue. |
Hi @engcom-Lima. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Lima, here is your Magento Instance: https://2a9984743397f28955e3503d1b3ef2b6.instances.magento-community.engineering |
✔️ Issue confirmed Issue got reproduced in 2.4-develop branch. Description: Product grid is not displayed in the admin panel. Pre-requisite:
Steps to reproduce:
Expected result: Grid should be displayed. Found new issue related to this issue : #35789 Thanks |
Hi, confirming this issue on |
I was using Magento 2.4.6 + PHP 8.2 on production environment and had a cron job running every midnight to scrape and automatically update product information. However, this morning when I checked the admin page, the product grid was not showing up. and fortunately, I found the cause. The product with SKU value "K00001" was originally an existing product. However, seeing that a new SKU "K00001-1" was created, it seems that during the scraping of product information, there was a duplication of the URL key, causing Magento to mistakenly create an empty product. Not only the "name" attribute, but other attributes used in the product were also empty. Therefore, I simply deleted the product using the "delete from ~" query, and the grid displayed correctly on the admin page. It's been a few months, and it happened again, so I came back here after searching on Google.
|
I ran the query above, returns no products without a name but I can still reproduce this issue on v2.4.6 |
@alitopaloglu You have the exact error with attribute name? if you have error with different key instead of name then you might have different require attributes missing values, make sure and query for the attribute which you see on the error |
I'm pretty sure it's the name attribute because the error message says Warning: Undefined array key "name" in vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php on line 61 |
@alitopaloglu You might have caching issue or try to print the product object to debug on the same file |
There is a PR up to solve this on the rendering layer, but I have no clue how to move forward from here. |
This error has also occurred for us when using the native product import - the default amount of errors is set to 10 for some reason, so you can import products with no name. |
This error occurs when you have imported any product without a name.
` |
Hello @MIANZAHOOR, @hgati @malikt and Team, We observe similar issue on Production where we are on Adobe Commerce ver. 2.4.5-p2 Please could you advise us how this can be troubleshooted and resolved potentially? Regards, |
You must have NULL values stored for attribute "visibility", so use the following query to find out those products
|
Hi @rohit-prjpt, |
Yes, that is patch in code, instead fix the value in database to fix it with current code,
|
Hello @rohit-prjpt @MIANZAHOOR @hgati We executed suggested query below in the database on Production, but unfortunately returned results were EMPTY. Can you please give us an idea what we should do with below line of code 286?
Regards, |
@MilenV In that case more detailed debug required, can't guess what is going on without debugging. |
Hello @rohit-prjpt I am providing you with the whole error we caught.
I hope this is helpful enough for troubleshooting and narrow down where the issue comes from and how to fix it. Regards, |
@MilenV looking at error log, seems to be error from amasty plugin, try to disable plugin amasty/pgrid and check. |
Hello @MilenV |
@MilenV And change it to the following: Let me know if that works or not! |
Hello @rohit-prjpt Below is the part of the code between lines 274 and 298: 274 protected function _initExtra(array &$row, string $column): void Regards, |
change your line 286 as per my reply above |
You have to add an additional check in which it will check the "visibility" index is set(available) or not because in you condition it doesn't found "visibility" index for $row array.
@rohit-prjpt you are right. |
I can reproduce using the import AND including the name field. If I specify |
When you import with store_view_code then it must set all values under defined store_view only but when you load the grid page by default it must have ADMIN Default Values but if you have store view filters in place then it must take values from specific store view, For this specific issue, you only need to query to fix NULL value in your database, nothing else |
For Enterprise version .
|
Hi, I am new to magento and I got the same issue. I have made a website on cloudways auto installation so I am unable to find these steps. But I did find it through another directory and set product searchable vale for name to NO but the issue is still not fixed. Can someone help? Thank you.
|
Hello, |
Thank you. I did not know how to run a query so I edited the product name in csv file, re-imported the file and it fixed the issue.
|
magento#35783 This change was suggested to handle the name not being set on a product. A bad import could happen or the name could not be in the selected data or the name turned off from being required. Without this the catalog grid becomes unusable and left in a state that admin user cannot recover from. Please make this change ASAP. Thanks.
Preconditions and environment
Steps to reproduce
Expected result
The Product Grid should load fine as usual.
Actual result
The Product Grid throws an alert of something went wrong and freezes.
Additional information
The Log shows the below error:
main.CRITICAL: Exception: Warning: Undefined array key "name" in /vendor/magento/module-catalog/Ui/Component/Listing/Columns/ProductActions.php on line 61 in /vendor/magento/framework/App/ErrorHandler.php:61
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: