Magento – Fatal error: Call to undefined method Mage_Tm_Googlemap_Helper_Data

admin-panelfatal errormagento-1.9user-roles

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.

Best Answer

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.