1

After having migrating Magento 1.9.4.5 to Magento 2.4, without any problems. Now, on the products page in the front-end I get a 404 error page not found but the categories pages are still all there.

All products are showing in the backend, however if i try to edit one i get a message saying "This product doesn't exist."

The error I get in exception log:

[2020-11-13 16:03:05] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sales_order_varchar' doesn't exist, query was: SELECT `u`.* FROM ( (SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `sales_order_varchar` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('106', '109', '493', '1158', '271', '929', '836', '96', '481', '998', '562', '570', '879', '880', '881', '103', '105', '571', '1155', '1156', '996', '905', '906')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `sales_order_int` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('863', '273', '110', '862', '860', '859', '274', '1154', '861', '526', '904', '944')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `catalog_product_entity_varchar` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('1104', '1045', '1105', '1129', '1062', '1054', '1079', '1078', '1114', '1108', '1109', '1110', '1111', '1112', '1113')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `sales_order_decimal` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('567', '100', '270', '503', '999', '99', '101')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `catalog_product_entity_int` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('1040', '1011', '1041', '1063', '1042', '949', '1043', '1044', '1116', '1130', '1074', '953', '956', '960', '955', '1056', '1081', '1076', '962', '1057', '954', '1107', '1075', '1094', '1088', '1089', '1090', '1093', '1095', '1098', '1099')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `sales_order_datetime` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('568', '569', '572', '573', '704', '705')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `sales_order_text` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('531', '104', '97', '506')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `catalog_product_entity_decimal` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('1117', '1118', '1120')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `catalog_product_entity_datetime` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('1143', '1144', '1091')) AND (`store_id` IN (0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `catalog_product_entity_text` AS `t` WHERE (entity_id = '1021') AND (attribute_id IN ('1096', '1097', '1100', '1101')) AND (`store_id` IN (0))) ) AS `u` ORDER BY `store_id` ASC

It's asking for a table "sales_order_varchar" but this table doesn't exist in de database not in the source database of Magento 1 or in destinations database of Magento 2. I did some searching but the table "sales_order_varchar" was deprecated after Magento 1.6. Can anyone point me in the right direction to fix this issue? Thank you all in advance.

Best regards,

Mike

1
  • If you do a search in the code base, which places is referencing the sales_order_varchar table?
    – Kristoffer
    Commented Nov 15, 2020 at 9:35

1 Answer 1

2

Solved it with the following query:

UPDATE eav_entity_attribute 
SET  entity_type_id = {entity_type_id_you_need}
WHERE entity_attribute_id IN (SELECT entity_attribute_id FROM (
    SELECT eea.*
    FROM `eav_entity_attribute` AS eea
    JOIN `eav_attribute` AS ea ON eea.`attribute_id` = ea.`attribute_id` 
    WHERE ea.`entity_type_id` =  {entity_type_id_you_need}
) as x);

{entity_type_id_you_need} you can check in eav_entity_type (entity_type_code = 'catalog_product')

Mike

1
  • Perfect, this worked for me.
    – Eric Brown
    Commented Mar 16, 2021 at 0:12

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.