Magento – Magento admin not displaying fully after module installation

adminmagento-1.7module

Ok So I've had some issues with removing modules from Magento recently, so I decided to scrap what i had before and start again with a slight name change to the module.

So i created the module, set it into my site and it didn't work, Once I reloaded up the admin pages I only saw the logo, the global search, logged in, date, the logout options and the next grey bar, which usually contains the main navigation for the admin section, however it was devoid of any links… the content section was empty.

So I stuck it on my local test server and i got the same, however the empty nav bar now contained the following error:

Fatal error: Class 'Chris_Homebanner_Helper_Data' not found in
C:\xampp\htdocs\magento\app\Mage.php on line 547

I finally installed a fresh copy of Magento on my local server, and it worked fine, all installed correctly.

So somehow along the road of building this site something has been done to break this. I've not changed or extended any of the Magento core however. The only thing I've really done recently is remove an entry from the core_resouce table and delete local module files for another module. So no idea how I could have caused an error like this by doing that.

Best Answer

It sounds to me like you may have added the module attribute inside your system.xml:

<?xml version="1.0"?>
<config>
    <sections>
        <homebanner translate="label" module="homebanner">
            ...
        </homebanner>
    </sections>
</config>

In the above, module="homebanner" causes Magento to require a default helper class (Chris_Homebanner_Helper_Data) in your module when accessing admin, but you haven't defined helpers in your config.xml. You can either remove module="homebanner" from your system.xml, or add helpers to your config.xml and create a helper class. To create a helper, in config.xml:

<?xml version="1.0"?>
<config>
    ...
    <global>
        ...
        <helpers>
            <homebanner>
                <class>Chris_Homebanner_Helper</class>
            </homebanner>
        </helpers>
        ...
    </global>
    ...
</config>

And then create the actual helper class, Chris/Homebanner/Helper/Data.php (it doesn't need any methods for this application):

<?php
class Chris_Homebanner_Helper_Data extends Mage_Core_Helper_Abstract
{

}