Magento(项目(Mage_Catalog_Model_Product)具有相同的ID" nnnnnn"已经存在)

时间:2015-08-10 09:54:15

标签: magento

在尝试将属性的状态从缺货状态更改为预订时,我们导致了以下错误。在使用数据分析器导入包含带有更新属性数据的SKU的CSV之后,我们发生这种情况,我们希望导入更新这些SKU的产品,但它似乎创建了重复的项目。

在查看管理员中的某个产品时,状态已更改为正确的值,但产品不再显示在网站中,所有更新的产品都出现错误消息。

我们通过在视图中添加groupby子句来修复此问题,但显然这只是一个临时修复,以使网站再次运行。我需要找到并删除dupcate项目,但不是Magento和EVA的专家我认为我会问是否有人这样做,以及正确的方法是什么。

Error:
Item (Mage_Catalog_Model_Product) with the same id "nnnnnn" already exist

Trace:
#0
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Eav/Model/Entity/Collect
ion/Abstract.php(267):
Varien_Data_Collection->addItem(Object(Mage_Catalog_Model_Product))
#1
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Eav/Model/Entity/Collect
ion/Abstract.php(1057):
Mage_Eav_Model_Entity_Collection_Abstract->addItem(Object(Mage_Catalog_Mod
el_Product))
#2
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Eav/Model/Entity/Collect
ion/Abstract.php(871):
Mage_Eav_Model_Entity_Collection_Abstract->_loadEntities(false, false)
#3
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Review/Model/Observer.ph
p(78): Mage_Eav_Model_Entity_Collection_Abstract->load()
#4
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Model/App.php(1303)
:
Mage_Review_Model_Observer->catalogBlockProductCollectionBeforeToHtml(Obje
ct(Varien_Event_Observer))
#5
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Model/App.php(1278)
:
Mage_Core_Model_App->_callObserverMethod(Object(Mage_Review_Model_Observer
), 'catalogBlockPro...', Object(Varien_Event_Observer))
#6 /var/www/vhosts/magento/htdocs/app/Mage.php(416):
Mage_Core_Model_App->dispatchEvent('catalog_block_p...', Array)
#7
/var/www/vhosts/magento/htdocs/app/code/local/Mage/Catalog/Block/Product/L
ist.php(190): Mage::dispatchEvent('catalog_block_p...', Array)
#8
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
862): Mage_Catalog_Block_Product_List->_beforeToHtml()
#9
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
582): Mage_Core_Block_Abstract->toHtml()
#10
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
526): Mage_Core_Block_Abstract->_getChildHtml('product_list', true)
#11
/var/www/vhosts/magento/htdocs/app/code/local/Mage/Catalog/Block/Category/
View.php(85): Mage_Core_Block_Abstract->getChildHtml('product_list')
#12
/var/www/vhosts/magento/htdocs/app/design/frontend/horticulture/default/te
mplate/catalog/category/view.phtml(295):
Mage_Catalog_Block_Category_View->getProductListHtml()
#13
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Template.php(
241): include('/var/www/vhosts...')
#14
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Template.php(
272): Mage_Core_Block_Template->fetchView('frontend/hortic...')
#15
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Template.php(
286): Mage_Core_Block_Template->renderView()
#16
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
863): Mage_Core_Block_Template->_toHtml()
#17
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Text/List.php
(43): Mage_Core_Block_Abstract->toHtml()
#18
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
863): Mage_Core_Block_Text_List->_toHtml()
#19
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
582): Mage_Core_Block_Abstract->toHtml()
#20
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#21
/var/www/vhosts/magento/htdocs/app/design/frontend/horticulture/default/te
mplate/page/3columns.phtml(59):
Mage_Core_Block_Abstract->getChildHtml('content')
#22
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Template.php(
241): include('/var/www/vhosts...')
#23
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Template.php(
272): Mage_Core_Block_Template->fetchView('frontend/hortic...')
#24
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Template.php(
286): Mage_Core_Block_Template->renderView()
#25
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Block/Abstract.php(
863): Mage_Core_Block_Template->_toHtml()
#26
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Model/Layout.php(52
9): Mage_Core_Block_Abstract->toHtml()
#27
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Controller/Varien/A
ction.php(392): Mage_Core_Model_Layout->getOutput()
#28
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Catalog/controllers/Cate
goryController.php(159):
Mage_Core_Controller_Varien_Action->renderLayout()
#29
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Controller/Varien/A
ction.php(421): Mage_Catalog_CategoryController->viewAction()
#30
/var/www/vhosts/magento/htdocs/app/code/local/Mage/Core/Controller/Varien/
Router/Standard.php(250):
Mage_Core_Controller_Varien_Action->dispatch('view')
#31
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Controller/Varien/F
ront.php(176):
Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Contro
ller_Request_Http))
#32
/var/www/vhosts/magento/htdocs/app/code/core/Mage/Core/Model/App.php(349):
Mage_Core_Controller_Varien_Front->dispatch()
#33 /var/www/vhosts/magento/htdocs/app/Mage.php(640):
Mage_Core_Model_App->run(Array)
#34 /var/www/vhosts/magento/htdocs/index.php(84):
Mage::run('hedgenursery', 'website')
#35 {main}

提前致谢:)

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。我尝试了以下解决方案,它为我工作。

解决方案:

编辑:/www/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php 行:256

替换:return parent :: addItem($ object);

使用:try {return parent :: addItem($ object); } catch(Exception $ ex){}