Item (Mage_Catalog_Model_Product) with the same id “xxx” already exist

There has been an error processing your request

Item (Mage_Catalog_Model_Product) with the same id "5214" already exist

http://stackoverflow.com/questions/8628764/magento-reports-products-products-ordered-issue-item-mage-catalog-model-pr

Man kann schon die Funktion abändern und die Fehlermeldung ignorieren. 
Ursache ist aber doch, dass manche Datensätze dupliziert oder mehrfach in der Tabelle zu finden sind.
Nicht unbedingt direkt in der Produkttabelle catalog_product_entity.
Sondern auch die Attributtabelle durchsuchen.

wie
SELECT count(*), `attribute_id` FROM catalog_product_entity_decimal where `entity_id` = 5214 group by `attribute_id`
decimal in SQL mit int, text, varchar ... austauchen und ausführen.

War auch nicht Problem hier. 

Weiter

In \lib\Varien\Data\Collection.php add exit before exception.

In \app\code\core\Mage\Eav\Model\Entity\Collection\Abstract.php add print_r($query) under _loadEntities to print SQL.

SELECT `e`.`entity_id`,
 `e`.`type_id`,
 `e`.`attribute_set_id`,
 `e`.`name`,
 `e`.`short_description`,
 `e`.`price`,
 `e`.`special_price`,
 `e`.`special_from_date`,
 `e`.`special_to_date`,
 `e`.`weight`,
 `e`.`small_image`,
 `e`.`thumbnail`,
 `e`.`news_from_date`,
 `e`.`news_to_date`,
 `e`.`status`,
 `e`.`tax_class_id`,
 `e`.`url_key`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`price_type`,
 `e`.`weight_type`, `e`.`price_view`, `e`.`shipment_type`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`humidorszie`,
 `e`.`humidorszie_value`, `e`.`is_imported`, `e`.`msrp_enabled`, `e`.`msrp_display_actual_price_type`, `e`.`msrp`,
 `search_result`.`relevance`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`,
 IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`,
 `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`,
 `at_rating_summary`.`rating_summary` 
 
 FROM `catalog_product_flat_1` AS `e` 
 INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id='340' 
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 
 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(3, 4) AND cat_index.category_id = '2' 
 LEFT JOIN `review_entity_summary` AS `at_rating_summary` ON (at_rating_summary.`entity_pk_value`=e.entity_id) AND (at_rating_summary.entity_type = '1') AND (at_rating_summary.store_id = '1') 
 WHERE (e.status = 1) and (e.entity_id = 5214) ORDER BY `relevance` desc, `e`.`name` ASC 
 
 Problem is, rating_summary duplicated.
 
 Trace: #0 web/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(265): Varien_Data_Collection->addItem(Object(Mage_Catalog_Model_Product))
#1 web/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(1055): Mage_Eav_Model_Entity_Collection_Abstract->addItem(Object(Mage_Catalog_Model_Product))
#2 web/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php(871): Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#3 web/app/code/core/Mage/Review/Model/Observer.php(78): Mage_Eav_Model_Entity_Collection_Abstract->load()
#4 web/app/code/core/Mage/Core/Model/App.php(1357): Mage_Review_Model_Observer->catalogBlockProductCollectionBeforeToHtml(Object(Varien_Event_Observer))
#5 web/app/code/core/Mage/Core/Model/App.php(1330): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Review_Model_Observer), 'catalogBlockPro...', Object(Varien_Event_Observer))
#6 web/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('catalog_block_p...', Array)
#7 web/app/code/local/Mage/Catalog/Block/Product/List.php(167): Mage::dispatchEvent('catalog_block_p...', Array)
#8 web/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Catalog_Block_Product_List->_beforeToHtml()
#9 web/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#10 web/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('search_result_l...', true)
#11 web/app/code/core/Mage/CatalogSearch/Block/Result.php(161): Mage_Core_Block_Abstract->getChildHtml('search_result_l...')
#12 web/app/design/frontend/default/ma_sahara_handbag1/template/catalogsearch/result.phtml(42): Mage_CatalogSearch_Block_Result->getProductListHtml()
#13 web/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/client...')
#14 web/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#15 web/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#16 web/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#17 web/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#18 web/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#19 web/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#20 web/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#21 web/app/design/frontend/default/ma_sahara_handbag1/template/page/2columns-left.phtml(59): Mage_Core_Block_Abstract->getChildHtml('content')
#22 web/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/client...')
#23 web/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#24 web/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#25 web/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#26 web/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#27 web/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#28 web/app/code/local/Magentothem/Layerednavigationajax/controllers/ResultController.php(124): Mage_Core_Controller_Varien_Action->renderLayout()
#29 web/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Magentothem_Layerednavigationajax_ResultController->indexAction()
#30 web/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#31 web/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#32 web/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#33 web/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#34 web/index.php(84): Mage::run('', 'store') #35 {main}

Leave a Reply

Your email address will not be published. Required fields are marked *


eight + 8 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>