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.

Fabian Schmengler
66.2k25 gold badges191 silver badges422 bronze badges
asked May 21, 2015 at 7:43
2
  • 1
    Good question.. Commented May 21, 2015 at 7:44
  • @AmitBera, Thank you Commented May 21, 2015 at 7:44

5 Answers 5

19
  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

answered May 21, 2015 at 9:38
1
  • Perfect answer ... Commented Nov 21, 2017 at 7:03
4
  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')) { ------- } }

Amit Bera
77.8k21 gold badges127 silver badges240 bronze badges
answered May 21, 2015 at 9:41
3

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>
Fabian Schmengler
66.2k25 gold badges191 silver badges422 bronze badges
answered May 21, 2015 at 7:47
2
  • If we change active tag to false, is it loads module? How Magento handle this? Commented May 21, 2015 at 7:55
  • it still load the module it will show in system > configuration > advanced. not not load module file like etc/config.xml. Commented May 21, 2015 at 8:01
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.

answered May 21, 2015 at 8:48
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.

answered May 21, 2015 at 7:45
1
  • Which file will load and which files are not in both the case? Commented May 21, 2015 at 7:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.