16

In magento I come to knew that we can disabel our module by two ways

  1. By navigating in the Magento backend to System > Configuration > Advanced > Disable modules output we can easily disable certain modules.
  2. In the directory app/etc/modules, by changing the active-tag from true to false.

May I know what is the exact difference in these two technic? Its very help if anyone give more detailed Answer.

  • 1
    Good question.. – Amit Bera May 21 '15 at 7:44
  • @AmitBera, Thank you – Charlie May 21 '15 at 7:44
17
  1. System > Configuration > Advanced > Disable Modules Output will not actually disable that module. It work as the name suggest, disable modules output.

    When you look at

    abstract class Mage_Core_Block_Abstract
    

    In

    final public function toHtml()
    {
        Mage::dispatchEvent('core_block_abstract_to_html_before', array('block' => $this));
        if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) {
            return '';
        } 
    
    // It is checking If its in disabled mode then just return blank output
    .......
    }
    
  2. While app/etc/modules completely disabled module

3
  1. By navigating in the Magento backend to System > Configuration > Advanced > Disable modules output we can easily disable certain modules.

    -- That means module will not render, doesn't send output to the screen but your module execute. Take a look app/code/core/Mage/Core/Block/Abstract.php -> toHtml

    if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) { return ''; }

  2. In the directory app/etc/modules, by changing the active-tag from true to false.

    ---- true/false define your module will be load or skip. Take a look app/code/core/Mage/Core/Model/Config.php -> loadModulesConfiguration

foreach ($modules as $modName=>$module) { if ($module->is('active')) { ------- } }

2

When you just Disable Modules Output, it means the module will not render anything on the screen, in programming terms: the _toHtml() function will return nothing. Everything else (observers, rewrites, controllers) will still be executed.

Ideally, if you want to disable a module properly, set "Active" is to false, and make sure no other module is extending it.

2

Configuration > Current Configuration Scope > Advanced > Advanced > Disable Module Output. This action only disables module output as it says. If your module uses, let’s say some Observer functionality to hook into some part of the system and does some overriding then those actions won’t be disabled.

To fully disable module, you need to go to module config file, like /etc/NAMESPACE_MyModule.xml, and set it’s active parametar to false, like:

< ?xml version="1.0"?>
<config>
<modules>
<NAMESPACE_mymodule>
<active>false</active>
<codepool>local</codepool>
</NAMESPACE_mymodule>
</modules>
</config>
  • If we change active tag to false, is it loads module? How Magento handle this? – Charlie May 21 '15 at 7:55
  • it still load the module it will show in system > configuration > advanced. not not load module file like etc/config.xml. – Qaisar Satti May 21 '15 at 8:01
0

"Disable modules output" only disables the block output defined by the extension. It does not skip execution of the module its code if, for example, it has observers defined.

  • Which file will load and which files are not in both the case? – Charlie May 21 '15 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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