Magento2: Error mergeMetadataElement() in backend product edit or add

Created on 1 Dec 2016  路  14Comments  路  Source: magento/magento2

After updating Magento 2.0.7 to 2.1.0 (2.11 and 2.1.2) when I try to edit a product in backend I got this error:

Recoverable Error: Argument 3 passed to Magento\Framework\View\Element\UiComponentFactory::mergeMetadataElement() must be of the type array, null given, called in /var/www/html/[magento_dir]/vendor/magento/framework/View/Element/UiComponentFactory.php on line 337 and defined in /var/www/html/[magento_dir]/vendor/magento/framework/View/Element/UiComponentFactory.php on line 287

needs update

Most helpful comment

I migrated the data from magento 1.9.3.7 to magento 2.2.5 using the data migration tool. When I click the add product button through admin panle, it showed me the same error. The way I resolved it was to go to Admin->Store->Attribute Set. And edited theDefault 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:reindex

Also make sure that the Schedule Design Update Group Contains the following attributes:

  • custom_design_from
  • custom_design_to
  • custom_design
  • custom_layout

And it worked for me...

All 14 comments

@primisuimotori Tried to remove var/generation folder?

Yes, done. Var and Static (backend) was removed and regenerated, but the errror remains.

@primisuimotori thank you for feedback.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.
Please, also identify which version of Magento you are running.

Solve, delete all database table for catalog (product & category) and eav attribute. After that I Imported the empty tables from a clean Magento 2.1.2 installation.

@primisuimotori That's just not an option if your environment is in production mode with a live site.

I'm closing this issue as it was resolved.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.

This issue seems to be the same as issue #5350

In case anyone comes across with this issue again, then please check if your product does have a valid attribute set. I had the same error when creating products programmatically without attribute set.

I migrated the data from magento 1.9.3.7 to magento 2.2.5 using the data migration tool. When I click the add product button through admin panle, it showed me the same error. The way I resolved it was to go to Admin->Store->Attribute Set. And edited theDefault 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:reindex

Also make sure that the Schedule Design Update Group Contains the following attributes:

  • custom_design_from
  • custom_design_to
  • custom_design
  • custom_layout

And it worked for me...

Encountered in 2.2.5 using the data migration tool.
In my case, the attribute set was missing.

If you get this error, check your attribute set as @Usman1493 and @keevitaja explained

products without sku in our case caused the problem

Adding

custom_design_from
custom_design_to
custom_design
custom_layout

to the Default Attribute set in the Schedule Design Update Group, and then executing php bin/magento indexer:reindex was solving it for me :)

After updating Magento 2.0.7 to 2.1.0 (2.11 and 2.1.2) when I try to edit a product in backend I got this error:

Recoverable Error: Argument 3 passed to Magento\Framework\View\Element\UiComponentFactory::mergeMetadataElement() must be of the type array, null given, called in /var/www/html/[magento_dir]/vendor/magento/framework/View/Element/UiComponentFactory.php on line 337 and defined in /var/www/html/[magento_dir]/vendor/magento/framework/View/Element/UiComponentFactory.php on line 287

I am getting the same issue, could you pls help me how you solved this issue?

Was this page helpful?
0 / 5 - 0 ratings