- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2017
05:12 AM
07-14-2017
05:12 AM
Catalog Price Rule throwing exception
Hello,
the customer created a new rule (which has ID 36), duplicating an old one, and now in the product view I get an exception:
Item (Mage_SalesRule_Model_Rule) with the same id "36" already exist
. If I comment in lib/Varien/Data/Collection.php:
public function addItem(Varien_Object $item) { $itemId = $this->_getItemId($item); if (!is_null($itemId)) { if (isset($this->_items[$itemId])) { //throw new Exception('Item ('.get_class($item).') with the same id "'.$item->getId().'" already exist'); } $this->_items[$itemId] = $item; } else { $this->_addItem($item); } return $this; }
the product view works correctly.
What is happening here and how to solve?
Many thanks
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2017
05:38 AM
07-14-2017
05:38 AM
Re: Catalog Price Rule throwing exception
You have to remove old one entry from your table because issue related to duplicate entry.
In magento you cant keep two element with same id in table.
You cant comment out core file its not proper solutions. This will break other functionality of magento.
if issue solved, Click Kudos/Accept as solutions.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial
Magento 2 Blogs/Tutorial
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2017
06:41 AM
07-14-2017
06:41 AM
Re: Catalog Price Rule throwing exception
The customer duplicated a rule from magento admin, and as you can see in the screenshot there are no 2 rules with same ID.
any other hint?
thanks