magento2: [EE 2.1.0] - Edit Product doesn't work after upgrade from 2.0.7 to 2.1.0
Steps to reproduce
- Upgrade Magento EE from 2.0.7 to 2.1.0
- Log in to backend and browse to products -> catalog
- Click on any product to edit
Expected result
- Product can be edited
Actual result
- HTTP ERROR 500
error log:
PHP message: PHP Fatal error: Uncaught TypeError: Argument 3 passed to Magento\Framework\View\Element\UiComponentFactory::mergeMetadataElement() must be of the type array, null given, called in /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php on line 335 and defined in /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php:287 Stack trace: #0 /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php(335): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataElement(Array, 'schedule-design...', NULL, false) #1 /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php(363): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false) #2 /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php(363): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
Workaround: If you disable following modules it will work properly: Magento_BundleStaging Magento_ConfigurableProductStaging Magento_CatalogImportExportStaging Magento_CatalogStaging Magento_DownloadableStaging Magento_ProductVideoStaging
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 14
- Comments: 30 (5 by maintainers)
Firstly, the issue should happen for the products using custom attribute sets. You just need to go to the database to fix the schedule design update attribute group in the custom attribute sets and then you should be able to access the product edit page. After that, you may be not able to save because of another issue - “Update with id “0” does not exist.”. For this following issue, you can solve it by update the value of the column “created_in” in the table “catalog_product_entity” from 0 to 1.
I spent whole day to solve it.
I scripted @jasonyip2014’s answer to:
@jasonyip2014 This works. I did as you said: 1) UPDATE
eav_attribute_groupSETtab_group_code= “advanced”,sort_order= 55 WHEREattribute_group_code= “schedule-design-update”; `// This will update default attribute set too but it should have these values already.UPDATE
catalog_product_entitySETcreated_in= “1”;Just in case, flushed cache storage, cleared var/generation/* and deployed static content in pub/static (not the magento command). And reindex everything with command magento indexer:reindex
Thank you
https://jira.corp.magento.com/browse/MAGETWO-55944 ticket closed as cannot reproduce so closing
For me following point 2 in the above message by @daniel-ifrim solved the problem. All the attribute sets must have those attributes in that group, this seems related to the scheduled updates feature.
Nonetheless it is quite disappointing to see a major bug like this in EE not fixed in two months.
Yes @vkhandelwal1993 is right. I migrated the data from magento 1.9.3.7 to magento 2.2.5. When I click the add product button it showed me the same error. The way I resolved it was to go Admin->Store->Attribute Set. And edited the Default and Migration_Default Attributes Set. Initially the Migration_Default Attribute had the attribute sets but the Default was empty. I added the attributes to the Default Attribute Set and executed the reindex command
sudo php bin/magento indexer:reindexAnd it worked…
Hi All, Those who are facing this error should check there attributes set in admin, for me the whole attribute set was empty (default + migration_default). Assign the attributes to the set, reindex the data and check the product
Also check if the attribute set id is set for that product or not in admin ( table catalog_product_entity)
Updating the value suggested by @jasonyip2014 corrects my product editing issue as well, but I’m still trying to understand why this is necessary. The InstallData.php script for the catalog-staging module explicitly sets the created_in value of all existing products to
0. As we’ve seen this destroys the ability to update products that existed prior to the 2.1 update, but is there a reason why this value was used? What does the created_in value actually mean in this context?