0

I am not able to enable cache from admin panel and system.log file generate below error :

Warning: Invalid argument supplied for foreach() in app/code/core/Mage/Adminhtml/controllers/CacheController.php on line 82

can any one help me please?

1
  • Could you post the full code in cachecontroller.php ...
    – aravind
    Dec 11, 2017 at 11:22

1 Answer 1

0

This is the code you are referring

public function massEnableAction()
{
    $types = $this->getRequest()->getParam('types');
    $allTypes = Mage::app()->useCache();

    $updatedTypes = 0;
    foreach ($types as $code) {
        if (empty($allTypes[$code])) {
            $allTypes[$code] = 1;
            $updatedTypes++;
        }
    }
    if ($updatedTypes > 0) {
        Mage::app()->saveUseCache($allTypes);
        $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) enabled.", $updatedTypes));
    }
    $this->_redirect('*/*');
}

Have you customized admin? It seems your request is missing types parameter, which indicates the cache types to enable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.