6

I am using magento 1.9 C.E and I have this issue whenever I try to disable any module from app/etc/modules/Mymodule_Custom.xml

    <active>false</false>

It throws the error Mage_Module_Helper_Data not found. I don't understand why it is coming and this is the problem with almost all the extensions that I'm using. Please help me out folks.

19
  • Can you give me the exact error. Bcoz I have face the same issue in past I can Help you in that Aug 20, 2016 at 10:37
  • Maybe your helper class is getting called from some other module, check the stack trace of error in exception.log
    – huzefam
    Aug 20, 2016 at 10:43
  • I have used a few extensions of this vendor and whenever, I'm trying to perform the activity of disabling the error is thrown. Aug 20, 2016 at 10:58
  • Fatal error: Class 'Mage_Price_Helper_Data' not found in /var/www/html/eleczo/trunk/app/Mage.php on line 547 Aug 20, 2016 at 11:00
  • The helper is probably still used by translations in XML. Search the XML files for module="mymodule_custom". Also, did you clear the cache? Aug 20, 2016 at 21:00

1 Answer 1

4
+25

The error

The error comes from the fact that the helper class of the module you're disabling is being used somewhere else in the code. For example, it could be:

  • In another module
  • In the templates

Find the file using it

So first, you need to find out what is the name of the helper.

To do so, open app/code/<codePool>/Mymodule/Custom/etc/config.xml and look for the following piece of code:

<helpers>
    <module>
        <class>Mymodule_Custom_Helper</class>
    </module>
</helpers>

Here you have to take note the name of the node between <helpers> and <class>. In my example, it is module

Now, you need to find out where this helper name is being used.

To do so, you can use the following command on your Magento root folder:

grep -r "module" . | grep -v "app/code/<codePool>/Mymodule/Custom"

This command basically means:

Look for the string module in my Magento folder but exclude the result from app/code/<codePool>/Mymodule/Custom

Thanks to this command you should be able to find where your helper is being used outside of your module quickly.

Notice: the command above will not exclude the templates or layout files from the module. Thus if your helper is being used in the module templates/layouts those files will be displayed in the list. To avoid that you can add extra grep to the command for instance:

grep -r "module" . | grep -v "app/code/<codePool>/Mymodule/Custom" | grep -v "app/design/frontend/base/default/template/mymodule/custom"

Once you found the code

Once you've found the code, I can't tell you what to do as it's a case by case decision. If you're disabling the module, you should definitely remove that helper call and/or refactor the file where it's being used.

7
  • I am not using the helper anywhere, not in that module or any other module or any phtml file. Sep 8, 2016 at 8:14
  • Also, when I am removing the complete module that is deleting the module, it is throwing the same error. Sep 8, 2016 at 8:15
  • @AbhishekDhanrajShahdeo yeah it is because your helper is definitely used somewhere. Give a try to my procedure Sep 8, 2016 at 8:16
  • I have checked the whole project, the helper is being used only in that module, when I'm completely deleting the whole code of that module, it is throwing the same error. Sep 8, 2016 at 8:26
  • @AbhishekDhanrajShahdeo maybe you have compilation enabled ? Check under System > Tools > Compilation and disable it, recompile then reenable it. Sep 8, 2016 at 8:31

Your Answer

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

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