diff --git a/app/code/community/Nexcessnet/Turpentine/controllers/Adminhtml/CacheController.php b/app/code/community/Nexcessnet/Turpentine/controllers/Adminhtml/CacheController.php index 9beb94935..bbeb7116b 100644 --- a/app/code/community/Nexcessnet/Turpentine/controllers/Adminhtml/CacheController.php +++ b/app/code/community/Nexcessnet/Turpentine/controllers/Adminhtml/CacheController.php @@ -8,6 +8,27 @@ class Nexcessnet_Turpentine_Adminhtml_CacheController extends Mage_Adminhtml_CacheController { + public function indexAction() + { + $allTypes = Mage::app()->useCache(); + + $turpentineEnabled = ($allTypes['turpentine_pages'] == 1) || ($allTypes['turpentine_esi_blocks'] == 1); + $fullPageEnabled = (array_key_exists('full_page', $allTypes)) && ($allTypes['full_page'] == 1); + + if ($fullPageEnabled && $turpentineEnabled) { + $allTypes['full_page'] = 0; + Mage::app()->saveUseCache($allTypes); + + Mage::getSingleton('core/session')->addWarning( + Mage::helper('adminhtml')->__('Both Varnish and Full Page caches were enabled. Full Page cache has now been disabled.') + ); + + $this->_redirect('*/*'); + return; + } + + parent::indexAction(); + } /** * Mass action for cache enabeling diff --git a/app/code/community/Nexcessnet/Turpentine/etc/config.xml b/app/code/community/Nexcessnet/Turpentine/etc/config.xml index 1de6007f7..0ebbaf874 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/config.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/config.xml @@ -497,6 +497,7 @@ Nexcessnet_Turpentine + Nexcessnet_Turpentine_Adminhtml