Skip to content

Instantly share code, notes, and snippets.

@t10u
Created February 1, 2012 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t10u/1717679 to your computer and use it in GitHub Desktop.
Save t10u/1717679 to your computer and use it in GitHub Desktop.
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php
index c3303e0..1fce578 100755
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php
@@ -453,23 +453,28 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model
*/
protected function _copyRelationIndexData($parentIds, $excludeIds = null)
{
- $write = $this->_getWriteAdapter();
- $select = $write->select()
- ->from($this->getTable('catalog/product_relation'), array('child_id'))
- ->where('parent_id IN(?)', $parentIds);
- if (!empty($excludeIds)) {
- $select->where('child_id NOT IN(?)', $excludeIds);
- }
+ try {
+ $write = $this->_getWriteAdapter();
+ $select = $write->select()
+ ->from($this->getTable('catalog/product_relation'), array('child_id'))
+ ->where('parent_id IN(?)', $parentIds);
+ if (!empty($excludeIds)) {
+ $select->where('child_id NOT IN(?)', $excludeIds);
+ }
- $children = $write->fetchCol($select);
+ $children = $write->fetchCol($select);
- if ($children) {
- $select = $write->select()
- ->from($this->getMainTable())
- ->where('entity_id IN(?)', $children);
- $query = $select->insertFromSelect($this->getIdxTable(), array(), false);
- $write->query($query);
+ if ($children) {
+ $select = $write->select()
+ ->from($this->getMainTable())
+ ->where('entity_id IN(?)', $children);
+ $query = $select->insertFromSelect($this->getIdxTable(), array(), false);
+ $write->query($query);
+ }
+ } catch (Exception $e) {
+ //-
}
+
return $this;
}
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php
index b130c9d..6f3a7ef 100755
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php
@@ -59,10 +59,14 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable
*/
public function reindexEntity($entityIds)
{
- $this->_prepareFinalPriceData($entityIds);
- $this->_applyCustomOption();
- $this->_applyConfigurableOption();
- $this->_movePriceDataToIndexTable();
+ try {
+ $this->_prepareFinalPriceData($entityIds);
+ $this->_applyCustomOption();
+ $this->_applyConfigurableOption();
+ $this->_movePriceDataToIndexTable();
+ } catch (Exception $e) {
+ //-
+ }
return $this;
}
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php
index 1886dc9..9e83e32 100755
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php
@@ -129,11 +129,15 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default
*/
public function reindexEntity($entityIds)
{
- $this->useDisableKeys(false);
- $this->_prepareFinalPriceData($entityIds);
- $this->_applyCustomOption();
- $this->_movePriceDataToIndexTable();
- $this->useDisableKeys(true);
+ try {
+ $this->useDisableKeys(false);
+ $this->_prepareFinalPriceData($entityIds);
+ $this->_applyCustomOption();
+ $this->_movePriceDataToIndexTable();
+ $this->useDisableKeys(true);
+ } catch (Exception $e) {
+ //-
+ }
return $this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment