-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 Import Fatal Error: Call to a member function getName() on null #4979
Comments
Hi @ljrweb I cannot reproduce this bug on Magento 2.0.9 and current develop branch. |
i have same issue on Magento 2.1.1. I got same error with sample data. |
I have the same issue om Magento 2.1.3. Same error, just with 5 lines of CSV. "PHP message: PHP Fatal error: Uncaught Error: Call to a member function getName() on null in /data/web/magento2/vendor/magento/module-catalog-import-export/Model/Import/Product/CategoryProcessor.php:80 |
I had the same issue, at the moment I have no idea what's the culprit but here's a quick fix for it. add this on top of it. |
Hello, @ljrweb. We could not reproduce Your issue neither on develop versions (2.0.15, 2.1.7, 2.2.0), nor on Your very one (2.0.7). Probably, the bug has already been fixed. Please let us know if You are still able to reproduce it on the develop version. Thanks for applying. |
Goto to your project folder Replace this
with
Also add a category factory in the product.php construct class
Once you have added, compile your project and refresh cache and deploy the content I suggest you , instead editing in core try overriding import and export model files |
One cause of this error is deleting one or more "core/root" categories by manually deleting from catalog_category_entity. |
It seems @magento-engcom-team is least interested in fixing these errors. |
Same issue in here on 2.2.2 after deleting product directly from database (catalog_product_entity table) until properly clearing all data of deleted products, and clear related categories as well (even url_rewrite table) the error still exists |
Same issue in here on 2.2.2 |
After manually deleting categories, make sure no existing category has a parent_id referencing a deleted one (don't forget to NOT delete the parent_id=0). That fixed it for me. |
Same issue here on 2.3.0 after fresh install |
I have issue in magento2.2.8 after deleting categories from direct database. Actually this is the error and it can be solved by coding. but magento team is not interested to solve this issue. |
Can check which categories are corrupt with var_dump($category->getPath()); in loop then check this id is really broke by calling url in admin area with this id |
For us this was due to some migrated data which resulted in a few categories existing when their parent no longer did. Deleting these categories with a Mysql query did the trick.
|
This solved it for me, thanks! |
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: