-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add class Mage_Adminhtml_Model_System_Config_Backend_Seo
to change category flas and product flat indexers status to require_reindex when configuration changed
- Loading branch information
1 parent
8341d2c
commit e33773c
Showing
3 changed files
with
54 additions
and
9 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Magento to newer | ||
* versions in the future. If you wish to customize Magento for your | ||
* needs please refer to http://www.magento.com for more information. | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
|
||
class Mage_Adminhtml_Model_System_Config_Backend_Seo extends Mage_Core_Model_Config_Data | ||
{ | ||
/** | ||
* Refresh categories and products url rewrites if configuration was changed | ||
*/ | ||
protected function _afterSave() | ||
{ | ||
if ($this->isValueChanged()) { | ||
Mage::getModel('index/indexer') | ||
->getProcessByCode(Mage_Catalog_Helper_Category_Flat::CATALOG_CATEGORY_FLAT_PROCESS_CODE) | ||
->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); | ||
|
||
Mage::getModel('index/indexer') | ||
->getProcessByCode(Mage_Catalog_Helper_Product_Flat::CATALOG_FLAT_PROCESS_CODE) | ||
->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); | ||
} | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters