magento2: Manufacturer error when upgrading to 2.2.6
Preconditions
- Magento 2.2.5
Steps to reproduce
- Upgrade to Magento 2.2.6
Expected result
- Upgrade succesfull
Actual result
- Getting error from missing attribute Manufacturer
I updated to Magento 2.2.6 via composer this morning however when running bin/magneto setup:upgrade I get the following error:
Attribute with ID “Manufacturer” does not exist
This shows after the Upgrading data part for Magento_ConfigurableProduct within the setup upgrade command. Am wondering how to fix this and or if anyone else is experiencing it?
This seems to be caused by below code within UpgradeData.php for the Configurable Product module:
if (version_compare($context->getVersion(), '2.2.1') < 0) {
$relatedProductTypes = $this->getRelatedProductTypes('manufacturer', $eavSetup);
if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
$relatedProductTypes[] = Configurable::TYPE_CODE;
$this->updateRelatedProductTypes('manufacturer', $relatedProductTypes, $eavSetup);
}
}
I do not have a manufacturer attribute within this instance and I’m wondering if it has been deleted. Looking at other instances however this attribute is present but not a system attribute and can be deleted from admin so am wondering if this attribute is really needed and if not this should not really cause setup:upgrade to break?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 37 (11 by maintainers)
Commits related to this issue
- MAGETWO-87047: Manufacturer attribute not appearing in Configurable Products on the backend — committed to magento/magento2 by viktym 6 years ago
Seems that for whatever reason during the upgrade from 2.2.5 to 2.2.6, new code did not actually preserved list of existing product types when updating the manufacturers plugin.
Looking at the catalog_eav_attribute table for the attribute_id that equals to your manufacturer attribute (you can look this up using:
select attribute_id from eav_attribute where attribute_code = 'manufacturer';
) - The value of the apply_to column in the catalog_eav_attribute has “,configurable” which only causes to be shown in configurable products.You can use following to apply quick work around for it:
update catalog_eav_attribute set apply_to = 'simple,virtual,bundle,downloadable,configurable' where attribute_id = YOUR_MANUFACTURER_ATTR_ID;
This is a colossal bug, this issue should not be closed until it’s been confirmed fixed in 2.2 and committed to the next point release.
@engcom-backlog-nazar: this NEEDS to be fixed in 2.2, you just can’t ignore this, this is a database migration script we are talking about here.
The fact that it works in 2.3-develop is probably because the database migration scripts are completely different there.
Re-opening.
For the ones that are searching for a quick fix:
Just add the manufacturer attribute under “Stores > Attributes > Product > Add New Attribute” as a dropdown attribute and set the scope, under Advanced Attribute Properties, to global.
After this we did the update and it was succesfull.
This is very easily reproducible, I understand that the steps to reproduce aren’t 100% accurate, but just reading @N1ghtfl0w’s post it’s easy to see what goes wrong.
So here are the exact steps to reproduce:
magento/product-community-edition
package from2.2.5
to2.2.6
composer update
bin/magento setup:upgrade
Result:
Same issue here, magento 2.3.1
Notice: Undefined index: manufacturer_bucket in /home/myserver/public_html/vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder/Term.php on line 23
Is there a solution for this matter?
Strange tom see that from a clean magento 2.3 installation i still have common issues like this. In my case I was advised by a message in magento admin to use Elastic search in stead of the default search engine of magento. If I look from the non programmer perspective it is running into the first problem following this advice.
In the end there is no way a Non programmer can find out what is going on here. And don’t mention how to reproduce such problems. So if you want to see what is happening even if you don’t understand it. You can:
copy public_html/pub/errors/local.xml.sample To public_html/pub/errors/local.xml
And post this result on the forums without a server name. I changed my server name to myserver.
Notice: Undefined index: manufacturer_bucket in /home/myserver/public_html/vendor/magento/module-elasticsearch/SearchAdapter/Aggregation/Builder/Term.php on line 23
2 the manufacturer attribute is there by default in magento 2.3 as a drop-down.
I can not confirm but I can assume everyone with a fresh install of magento 2.3 could have these issues.
Maybe someone can help me out?
@hostep thanks man! Haha. I will do this now. 👍
Anyone know the commit ref for this change that has led to the manufacturer attribute disappearing from simple products?
@N1ghtfl0w, thank you for your report. We’ve acknowledge the issue and added to our backlog.