3

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!

  • 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 Jan 10 '18 at 16:56
  • @iphigenie see my answer. I hope it helps! – Bilal Usean Jan 10 '18 at 17:09
4

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.

  • 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 Jan 11 '18 at 13:01
  • saved my day bro – Vinod Kumar Jul 3 '18 at 17:52
  • just happened to me again after running the import to 2.3 – iphigenie Feb 1 at 11:51
  • Hi.I also have this problem after 2.3 version. Any solutions please? – G. G. Apr 11 at 14:40
2

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.

0

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";

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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