I know there is a similar issue regarding a product, but now I've got this error with a category.
I can't recall that I did something different, it just all of a sudden started throwing this error as soon as I got on a category page on the frontend.
Sometimes re-saving the category in the admin resolved the issue, but most of the time it doesn't. Where does this error come from? How to fix it? Did anyone else encounter this error too?
Edit
It looks like the category page asks the URL rewrite table for the URL's. It generates this query:
SELECT `e`.*,
IF(at_is_active.value_id > 0, at_is_active.value,
at_is_active_default.value) AS
`is_active`,
`url_rewrite`.`request_path`
FROM `catalog_category_entity` AS `e`
INNER JOIN `catalog_category_entity_int` AS `at_is_active_default`
ON ( `at_is_active_default`.`entity_id` = `e`.`entity_id`)
AND ( `at_is_active_default`.`attribute_id` = '46' )
AND `at_is_active_default`.`store_id` = 0
LEFT JOIN `catalog_category_entity_int` AS `at_is_active`
ON ( `at_is_active`.`entity_id` = `e`.`entity_id` )
AND ( `at_is_active`.`attribute_id` = '46' )
AND ( `at_is_active`.`store_id` = 1 )
LEFT JOIN `url_rewrite`
ON ( url_rewrite.entity_id = e.entity_id )
AND ( url_rewrite.is_autogenerated = 1
AND url_rewrite.store_id = 1
AND url_rewrite.entity_type = 'category' )
WHERE ( IF(at_is_active.value_id > 0, at_is_active.value,
at_is_active_default.value)
=
'1' )
AND ( `e`.`entity_id` IN( '10', '170', '171', '172',
'173', '175', '176', '177',
'178', '179', '180', '189', '276' ) )
ORDER BY `e`.`position` ASC
But if your url_rewrite
-table is corrupted (which is most likely in my case), it ends up with having duplicate ID's.
Sometimes re-saving the category in the admin resolved the issue
This worked for me, Thanks!!