diff --git a/code/Model/Observer.php b/code/Model/Observer.php index b2135a7..c6a4aa8 100644 --- a/code/Model/Observer.php +++ b/code/Model/Observer.php @@ -81,12 +81,11 @@ protected function _indexSearch(&$productIds) */ protected function _indexProductRewrites(&$productIds) { - // Only generate URL rewrites when this module is enabled. - $indexer = Mage::getResourceSingleton('ecomdev_urlrewrite/indexer'); - if ($indexer) { - return $indexer->updateProductRewrites($productIds); + if (!Mage::helper('core')->isModuleEnabled('EcomDev_UrlRewrite')) { + return $this; } - return $this; + + return Mage::getResourceSingleton('ecomdev_urlrewrite/indexer')->updateProductRewrites($productIds); } /** @@ -97,12 +96,11 @@ protected function _indexProductRewrites(&$productIds) */ protected function _indexCategoryRewrites(&$categoryIds) { - // Only generate URL rewrites when this module is enabled. - $indexer = Mage::getResourceSingleton('ecomdev_urlrewrite/indexer'); - if ($indexer) { - return $indexer->updateCategoryRewrites($categoryIds); + if (!Mage::helper('core')->isModuleEnabled('EcomDev_UrlRewrite')) { + return $this; } - return $this; + + return Mage::getResourceSingleton('ecomdev_urlrewrite/indexer')->updateCategoryRewrites($categoryIds); } /**