Manufacturer attribute missing when updating (2.2.6)

I am experiencing an issue while updating magento to the latest version. The update from 2.2.5 to 2.2.6 completed successfully but the manufacturer attribute does not appear when editing a product on the backend. The manufacturer attribute shows on the frontend product page for products that were created before the 2.2.6 upgrade but does not appear for products created after. It no longer shows in the backend for any products; it still is listed under the Stores > Attributes Product page.
I found this discussion about the problem here : https://github.com/magento/magento2/issues/18134
However, i am not able to apply the fix. Maybe someone can help?
Thanks!

Oh boy… There’s been some proper bugs slipping through the net with there recent updates. I wasn’t aware of this one, so thanks for highlighting this.

So, I’ve just read through the github issue and I think I understand the problem. When you say “I am not able to apply the fix”, are you referring to the workaround by ajusev?

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;

It looks like it would work, but I won’t be able to test until maybe tomorrow (as I’m still working with 2.2.5).

thank you for your quick reply Craig.
Yes, i would like to apply that workaround and be able to import new products with a manufacturer.
I don’t really understand how to implement the fix. Is it does via SSH?
Would you be able to guide me or explain further how to do it ?

Many thanks

So, this fix revolves around your Magento 2 Database. Now, you could do this via SSH, but I wouldn’t recommend it.

Accessing your database via phpMyAdmin
Instead, you’ll need to access your database via phpMyAdmin. Depending on how you’ve setup your server, you’ll access phpMyAdmin via:

  1. The URL you that chose when installing phpMyAdmin (Dedicated self-build)
  2. Somewhere via your cPanel/Plesk/etc. Refer to your hosting documentation (Shared Hosting)

Only you will know which one. But I suspect you’re using Shared Hosting.

Note: phpMyAdmin will look something like this:

Part 1: Finding your Manufacturer ID
First, we need to find the attribute_id for manufacturer.

  1. Log into phpMyAdmin. You’ll see a list of databases on the left. Click on the database relating to your Magento installation. You’ll probably only see one as you’re on Shared Hosting.
  2. You’ll now see a list of tables in the main window. Scroll down to catalog_eav_attribute and click on it.

  1. Now you’ll see a list of records for the table you just clicked on. At the top click on the SQL tab. This will allow you to run SQL queries.
  2. In the box, you will see some text already in there. Delete what’s there and copy/paste the below SQL Query below:
    select attribute_id from eav_attribute where attribute_code = 'manufacturer';
  3. Once you’ve replaced the existing text with the above, you need to press the Go button to run the SQL query.

  1. Now that the query has executed, you should see a single result. In my case, the number is “83”. However, yours may be different. Keep a note of this number as we’ll need it for Part 2.

Part 2: Updating the record
Now, it is time to update the manufacturer record using the attribute_id that we just found.

  1. We need to run another SQL query, but we need to run this from the main database. So, just like Step 1, Click the database on the left. This will take you back to the main screen where you see a list of tables.
  2. Now, click on the SQL tab as you did in Step 3. This time there shouldn’t be any text for you to delete, so it will be completely empty.
  3. In the box, copy/paste the below SQL Query below: (Remember, my attribute_id was “83”. If yours is different, change this)
    update catalog_eav_attribute set apply_to = 'simple,virtual,bundle,downloadable,configurable' where attribute_id = 83;
  4. Once you have pasted the query above and changed the number to yours, you need to press the Go button to run the SQL query.

You will know that the command has ran correctly, as the page that loads should look something like this:

Final words…
And that will have updated your database so you should now see Manufacturer on the backend.

If this helped solve your problem, consider using the Tip Jar, but it’s not necessary.

Usual Disclaimer: Make sure you backup your server before making any changes. I didn’t write the solution, I simply explained how to execute it - I haven’t actually tried the solution.

Thank you for taking the time to investigate this. You are correct, I am using shared hosting and I do know how to access my database via phpMyAdmin.
Talk to you soon.

I’ve edited my reply with the full guide. Please, follow each step very carefully.

Good luck :+1:

Very good and detailed explanation. Too bad I cannot get it to work.
i am getting the following error :

any idea ?

Looks like you’re using a prefix for your tables “mghw_”, so you need to amend the SQL queries to reflect that. Try these:

Part 1
select attribute_id from mghw_eav_attribute where attribute_code = 'manufacturer';

Part 2
update mghw_catalog_eav_attribute set apply_to = 'simple,virtual,bundle,downloadable,configurable' where attribute_id = 83;

Remember to change “83” to the number you get in Part 1.

It works now, many thanks Craig!
Your help is much appreciated.
I will take the time to properly introduce myself and my project once I have a bit more time.
Keep up the good work :slight_smile:

1 Like