As @manadev-com-team said, the root issues is deleting an attribute through any means other than the Magento Admin. This can be through direct database manipulation, or the removeAttribute()
method in a module installer.
First, make sure that you reindex catalog_product_attribute
. If you have Flat Catalog enabled for products, reindex that as well.
Then, run the following queries against your database:
DELETE fs, fv, fvs
FROM m_filter2 f
INNER JOIN m_filter2_store fs
ON f.id = fs.global_id
INNER JOIN m_filter2_value fv
ON f.id = fv.filter_id
INNER JOIN m_filter2_value fvs
ON f.id = fvs.filter_id
WHERE f.id IN(
SELECT f.id FROM m_filter2 f
LEFT JOIN eav_attribute eav
ON f.code = eav.attribute_code
AND eav.entity_type_id = (
SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product'
)
WHERE eav.attribute_id IS NULL
AND f.code != 'category'
);
DELETE f
FROM m_filter2 f
LEFT JOIN eav_attribute eav
ON f.code = eav.attribute_code
AND eav.entity_type_id = (
SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product'
)
WHERE eav.attribute_id IS NULL
AND f.code != 'category';
These queries will delete any "filters" (attributes) and all related information in Manadev tables for any attributes which no longer exist in Magento, (excluding the category
filter, which doesn't actually match an attribute in Magento.)
Finally, it wouldn't hurt to rerun all of the Manadev indexers.