4

I've stripped my module down to try and identify this error. The following are my files. Can you see why I get the error "Fatal error: Class 'Mage_Caitlinhavener_Addschool_Helper_Data' not found in /var/www/DTS_staging/public_html/app/Mage.php on line 546" on dashboard page?

Caitlinhavener/AddSchooltest/etc/config.xml:

<?xml version="1.0"?>
  <config>
    <modules>
        <Caitlinhavener_Addschooltest>
            <version>0.1.0</version>
        </Caitlinhavener_Addschooltest>
    </modules> 

    <global>
        <helpers>
            <Addschooltest>
                <class>Caitlinhavener_Addschool_Helper</class>
            </Addschooltest>
        </helpers>  
    </global> 

    <admin>
        <routers>
           <adminhtml>
                <use>admin</use>
                <args>
                    <modules>
                        <Caitlinhavener_Addschooltest after="Mage_Adminhtml">Caitlinhavener_Addschooltest</Caitlinhavener_Addschooltest>
                    </modules>
                </args>
           </adminhtml>           
        </routers>      
    </admin> 
</config>

Caitlinhavener/AddSchooltest/etc/adminhtml.xml:

<?xml version="1.0"?>
<config>
    <menu>
        <SchoolMenu translate="title" module="Caitlinhavener_Addschooltest">
            <title>Schools</title>
            <sort_order>23</sort_order>
            <children>
                <myitem2 translate="title" module="Caitlinhavener_Addschooltest">
                        <title>Add Schools</title>
                        <action>adminhtml/addschool</action>
                        <sort_order>2</sort_order>                        
                </myitem2>
            </children>
        </SchoolMenu>
    </menu>
</config>    

Caitlinhavener/Addschooltest/Helper/Data.php:

<?php
class Caitlinhavener_Addschooltest_Helper_Data extends Mage_Core_Helper_Data
{
}

Caitlinhavener/Addschooltest/controllers/AddschoolController.php:

<?php

class Caitlinhavener_Addschooltest_AddschoolController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}
dotancohen
  • 1,115
  • 6
  • 18
CaitlinHavener
  • 779
  • 2
  • 20
  • 42

2 Answers2

9

The module attributes on your xml elements should be Addschooltest, like the alias you gave your helpers in config.xml instead of Caitlinhavener_Addschooltest.
Off topic a bit: You might want to change this to a lowercase value. I mean:

<helpers>
    <addschooltest><!-- helper alias -->
        <class>Caitlinhavener_Addschool_Helper</class>
    </addschooltest>
</helpers> 

After that your adminhtml.xml file should look like this:

<?xml version="1.0"?>
<config>
    <menu>
        <SchoolMenu translate="title" module="addschooltest">
            <title>Schools</title>
            <sort_order>23</sort_order>
            <children>
                <myitem2 translate="title" module="addschooltest">
                        <title>Add Schools</title>
                        <action>adminhtml/addschool</action>
                        <sort_order>2</sort_order>                        
                </myitem2>
            </children>
        </SchoolMenu>
    </menu>
</config>    
Marius
  • 197,939
  • 53
  • 422
  • 830
  • Made identical changes... deleted cache and session files... reindexed... same error on dashboard :( – CaitlinHavener Aug 08 '13 at 19:06
  • @CaitlinHavener this means that there is an other occurrence of module="Caitlinhavener_Addschooltest" in an other xml file. – Marius Aug 08 '13 at 19:12
  • I have a replica module but without test at the end... but I deleted its /etc/modules/ xml file... I'll try deleting the whole module. – CaitlinHavener Aug 08 '13 at 20:21
  • I deleted the other modules Caitlinhavener/Addschool... discovered that my activation xml file was tagged Caitlinhavener_Addschool instead of Caitlinhavener_Addschooltest. Made those changes and deleted cache files. .. still have the error. – CaitlinHavener Aug 08 '13 at 20:45
  • @CaitlinHavener. I'm 99.9% sure the error comes from an xml file. like I described. To debug this, try to disable your modules one by one until you isolate the problem. Then check the xml files in your module (etc and layout) – Marius Aug 09 '13 at 06:43
3

The helper class prefix you're declaring does not match the one that you're using (Caitlinhavener_Addschooltest_Helper_Data)

In your config.xml, change it from

<class>Caitlinhavener_Addschool_Helper</class>

to

<class>Caitlinhavener_Addschooltest_Helper</class>
Steve Robbins
  • 2,579
  • 2
  • 28
  • 44