Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Helper Class Not Found Error

Tags:

xml

magento

I am learning to create a custom extension by following this tutorial, http://www.pierrefay.fr/category/developpement/magento

When I try to open extension admin I m getting Fatal error: Class 'Mage_Test_Helper_Data' not found in /var/www/html/dev/app/Mage.php on line 520

But I think I am not using helper class anywhere in the extension.Your suggestions are welcome.

Here is my config.xml file

<?xml version="1.0"?>
<config>
    <modules>
        <Package_Test>
            <version>1.0.0</version>
        </Package_Test>
    </modules>
    <frontend>
        <routers>
            <routerfrontend>
                <use>standard</use>
                <args>
                    <module>Package_Test</module>
                    <frontName>test</frontName>
                </args>
            </routerfrontend>
        </routers> 
        <layout>
            <updates>
                <test>
                    <file>test.xml</file>
                </test>
            </updates>
        </layout>    
    </frontend>
    <admin> 
        <routers>
            <test>  
                <use>admin</use>
                <args>
                    <module>Package_Test</module>
                    <frontName>admintest</frontName>
                </args>
            </test>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <test>
                    <file>test.xml</file>
                </test>
            </updates>
        </layout>
        <menu>
        <test translate="title" module="adminhtml">
            <title>My Module</title>
            <sort_order>100</sort_order>
            <children>
                <items module="Test">
                    <title>Address Book</title>
                    <action>admintest/adminhtml_index</action>
                </items>
            </children>
        </test>
        </menu>
    </adminhtml>
    <global>
         <helpers>
            <class>Package_Test_Helper</class>
         </helpers>
        <blocks>
            <test>
                <class>Package_Test_Block</class>
            </test>
        </blocks>
        <models>
            <test>
                <class>Package_Test_Model</class>
                <resourceModel>test_mysql4</resourceModel>
            </test>
            <test_mysql4>
                <class>Package_Test_Model_Mysql4</class>
                <entities>
                    <test>
                        <table>package_test</table>
                    </test>
                </entities>
            </test_mysql4>
        </models>
        <resources>
            <test_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </test_write>
            <test_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </test_read>
        </resources>
    </global>
</config>
like image 936
blakcaps Avatar asked Aug 30 '11 11:08

blakcaps


2 Answers

If you have compilation enabled, trying disabling or re-compiling in System, Tools, Compilation.

If you can't get into the admin interface but have SSH access you can disable it there with:

php -f shell/compiler.php -- disable
php -f shell/compiler.php -- clear
php -f shell/compiler.php -- state

The final output should appear like:

Compiler Status:          Disabled
Compilation State:        Not Compiled
Collected Files Count:    0
Compiled Scopes Count:    0
like image 155
reflexiv Avatar answered Oct 21 '22 10:10

reflexiv


Even if you yourself don't use helper, Magento admin does. That's why you should always include Data helper in your extensions. So the following code in your Helper/Data.php

class Package_Test_Helper_Data extends Mage_Core_Helper_Abstract
{

}

and

<global>
    <helpers>
        <test>
            <class>Package_Test_Helper</class>
        </test>
    </helpers>
</global>

in your config.xml should be enough.

like image 21
Alexei Yerofeyev Avatar answered Oct 21 '22 11:10

Alexei Yerofeyev