0

Fatal error: Call to undefined method Mage_Tm_Googlemap_Helper_Data::__() in /home/mypetshop/public_html/app/code/core/Mage/Admin/Model/Roles.php on line 160

I get this error when I try to Add new roles in my Magento Admin panel or edit an existing role.

3 Answers 3

1

Most probably, you are using a module called "Tm_Googlemap" that has an admin configuration area. When a module uses the admin configuration and role system, it must have a Helper-class defined for translations. I guess you can find the module in app/code/(local|community)/Tm/Googlemap/, and it will have a system.xml and adminhtml.xml in its etc/-directory.

There you will find a node like:

<tm_googlemap_options module="Tm_Googlemap">[...]

Then, go into the module's config.xml file. Either there is already a node global/helper, or you must create a new one:

[...]
<helpers>
    <Tm_Googlemap> <!-- make sure you use the string from modules="..." -->
        <class>Tm_Googlemap_Helper</class>
    </Tm_Googlemap>
</helpers>
[...]

After this, check the module directory again. If there ist no folder Helper/ with a file called Data.php, create it. Then, insert these contents:

<?php

class Tm_Googlemap_Helper_Data extends Mage_Core_Helper_Abstract {}

Flush cache, logout and login from the admin panel - it should work then! Make sure to uncomment the line you commented, changes in the /core/-directory are no-go im Magento.

2
  • Thanks @simonthesorcerer but all files exist properly the way you showed in your answer! I am confused what i have to do? Commented Jun 10, 2016 at 9:17
  • Does the string in module="" and the helper class from the config.xml match? You could also check adminhtml.xml Commented Jun 10, 2016 at 15:19
0

Is this Your module or third party extension? Probably the class Mage_Tm_Googlemap_Helper_Data does not exists, have typo in name or is not defined in module config

<global>
  <helpers>
    <module>
      <class>Company_Module_Helper</class>
    </module>
  </helpers>
</global>

Also check if this module extends Mage_Core_Helper_Abstract

2
  • I am new in Magento. I know the class Mage_Tm_Googlemap_Helper_Data does not exist. How to check if this module extends Mage_Core_Helper_Abstract??? Please guide. Commented May 25, 2016 at 9:29
  • One thing I can say is this error occurs due to some third party extension (plugin) I have installed but which plugin I really don't know. Commented May 25, 2016 at 9:35
0

After all my research found a quick fix. Just comment the line on which you are getting error. In my case I commented line no. 160 in app/code/core/Mage/Admin/Model/Roles.php

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.