4

I migrated from Magento 1.9.3.3 to Magento 2.1.7 EE. I have one issue, that is some of the attributes(multiple select) not shown in layer navigation.

Create new category called test, Assign two products to test category, that two products have multiple select attributes.

Multiple select attribute have the below propertiesenter image description here

but it is not rendering in layer navigation.

If anyone faces this issue before, please post the solution.

Note: Migrated attributes only have this issues, If I create a new attribute with similar fashion, it works!

2
  • did you ever figure out the issue, i have the same problem in 2.2.2, just like you mention, only on "multiple select" attributes migrated... I suspect some field or mapping is missing...
    – iphigenie
    Commented Jan 10, 2018 at 16:56
  • @iphigenie see my answer. I hope it helps! Commented Jan 10, 2018 at 17:09

4 Answers 4

6

The steps to resolve this issue after migrating is first to open the attribute and save it again, this will set the type from text to varchar. After this run the SQL below to copy all data from the text to the varchar table.

INSERT INTO catalog_product_entity_varchar
(store_id, attribute_id, entity_id, value)
    SELECT store_id, attribute_id, entity_id, value
    FROM catalog_product_entity_text
    WHERE catalog_product_entity_text.attribute_id = {your attribute id}
    AND catalog_product_entity_text.value is not null;

Now delete the data from the text table

DELETE FROM `catalog_product_entity_text`
WHERE `attribute_id` = {your attribute id}

Run in terminal

  • php magento2/bin/magento indexer:reindex
  • php magento2/bin/magento cache:flush

If the reindex is giving a duplication error, search for the entity_id in the catalog_product_entity_varchar table and check if there is a duplicate value for the attribute id in the field.

1
  • Great and efficient solution Commented Mar 5, 2021 at 15:33
5

In my case migrated multi-select attribute has invalid backend_type value as text, it should be varchar for multiple select

After changing backend_type from text to varchar, it's working.

4
  • Thanks for the pointer! I can see that this is indeed wrong on my site too. Simply saving the attribute in admin will correct the backend type. Alas that did not move the data itself which is still catalog_product_entity_text when it should be in catalog_product_entity_varchar so I'll check if I can reimport or just do that manually, thankfully it is only 8 attributes.
    – iphigenie
    Commented Jan 11, 2018 at 13:01
  • saved my day bro Commented Jul 3, 2018 at 17:52
  • just happened to me again after running the import to 2.3
    – iphigenie
    Commented Feb 1, 2019 at 11:51
  • 1
    Hi.I also have this problem after 2.3 version. Any solutions please?
    – G. G.
    Commented Apr 11, 2019 at 14:40
4

Thank you to the other answers. I've put together a full fix to migrate the affected attributes.

This issue can be caused by a product migration. The multi-select attribute has the backend_type value as text when it should be varchar.

See if this issue affects the website (you will get no records returned if you are okay):

SELECT * from eav_attribute WHERE entity_type_id=4 AND frontend_input="multiselect" AND backend_type="text";

Copy data values from text to varchar table:

INSERT INTO catalog_product_entity_varchar (store_id, attribute_id, entity_id, value) SELECT store_id, attribute_id, entity_id, value FROM catalog_product_entity_text WHERE catalog_product_entity_text.attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE frontend_input="multiselect" AND backend_type="text") AND catalog_product_entity_text.value is not null;

Delete text values:

DELETE FROM catalog_product_entity_text WHERE attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE frontend_input="multiselect" AND backend_type="text");

Change attribute type:

UPDATE eav_attribute SET backend_type="varchar" WHERE frontend_input="multiselect" AND backend_type="text" AND entity_type_id=4;

After this reindex the website, clear the cache, and the attributes should appear in the layered navigation.

0

There is a thread below and pull request around this which effects the catalog layered navigation as well. The data migration library in /vendor has been updated.

https://github.com/magento/data-migration-tool/issues/646 https://github.com/magento/data-migration-tool/commit/c65b2839ac03ccc56aab5b37dbada95d61757034

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.