The Magento module has been renamed, but Magento continues to ask for the old helper class.

Magento, CE versions 1.4.2, 1.5.0.1, 1.5.1.0

I had to adapt the payment module for Magento, following all the recipes, config.xml , system.xml , etc/module/Mycompany_Mypaymentmodule.xml , which all work fine.

But recently, I double-checked and found an error: in my config.xml I set:

 <config> <modules> <Mage_Mycompany> <version>0.1.0</version> </Mage_Mycompany> </modules> 

...

This is because initially the module had to be placed in the community folder.
Following the recommendations, I rewrote classes, xml, etc., to reflect local code. This also went well (except for the error I was debugging).

However, inside config.xml I renamed the modules tag, for example:

 <config> <modules> <Mycompany_Mypaymentmodule> <version>0.1.0</version> </Mycompany_Mypaymentmodule> </modules> 

The strange thing is that Magento now asks me to use the old Helper class file when I switch to payment methods in the backend, resulting in:

Fatal error: class 'Mage_Mycompany_Helper_Data' was not found in the path \ to \ app \ Mage.php on line 520

In other words, Magento continues to ask for a helper class for my old, previously renamed module, which, of course, is nowhere to be found.

I did an extensive search in all files, but the Mage_Mycompany row Mage_Mycompany not found anywhere, so I assume Magento is trying to load this helper class from the database table. Of course, I cleared the cache and rebuilt all the indexes several times and deleted all the cache files. I also checked almost all the database tables, but to no avail.

Secondly, when I manually create a helper class in app/code/community/Mage/Mycompany/Helper/Data.php , everything goes well, which sounds strange to me because the class itself should not be called (since it is never mentioned in no config.xml).

I need to miss something, and maybe the class name is generated on the fly, but I really don't know how to avoid it or fix it ... so any help is appreciated!

+4
source share
2 answers

The first step, of course, is to clear the cache.

If the clearing cache does not work.

Step 2: The auxiliary data class is used to translate the lines for the module. That is, each data helper has a method

 $helper->__('Translate this symbol'); 

which converts the string to this module helper file.

Throughout the system, there are several XML files in which you might want to translate certain nodes. The syntax looks something like this.

 <dhl translate="label" module="usa"> <label>The Label</label> </dhl> 

Here you are talking magento about translating the "label" of a node enclosed in dhl and for using this usa module. That is, use a helper created as

 $Mage::getModel('usa/data'); //same thing as above, helpers default to data Mage::getModel('usa'); 

for label translation

 $helper->__('The Label'); 

My guess is that one of your XML files still contains your old translation module

 <sometag module="mycompany" translate="someothertag" /> 

which makes magento look for an assistant who is no longer there, and an arrow, there is your mistake.

+2
source

The Tha Data helper is loaded when you call the translation helper, i.e. Mage::helper('modulename')->__("some string to translate") .
In your config.xml, did you declare a helper module class ?:

 <config> ... <global> ... <helpers> <yourmodule> <class>Yourcompanyname_Yourmodule_Helper</class> </yourmodule> </helpers> ... </global> ... </config> 
0
source

All Articles