This is common when referencing a missing helper. In many cases the class name itself is malformed or your shortname referencing it is incorrect, which is why Magento is looking for it in the path Mage_Giftcards_Helper_Data
(see example 1 below). For the following examples I have set up a module called MyCompany_MyModule
.
These are just a few of the many ways you can go awry with defining helpers:
Incorrect helper class alias:
I reference my helper as:
$helper = Mage::helper('mycompany');
I get the error:
Fatal error: Class 'Mage_Mycompany_Helper_Data' not found
What went wrong?
My helper class alias is defined as mymodule
:
<helpers>
<mymodule>
<class>MyCompany_MyModule_Helper</class>
</mymodule>
</helpers>
Changing my shortcode to Mage::helper('mymodule')
produced the desired result.
Malformed class name
I reference my helper (correctly this time):
$helper = Mage::helper('mymodule');
I receive:
Fatal error: Class 'MyCompany_MyModule_Helper_Data' not found
What went wrong?
My class definition was missing "_Data":
class MyCompany_MyModule_Helper extends Mage_Core_Helper_Abstract
{
}
Helper/Custom:
This is similar to what happens when you try to refer to a helper class within a file not named "Data.php".
I reference my helper as:
$helper = Mage::helper('custom');
My module helper path was defined as:
<helpers>
<mymodule>
<class>MyCompany_MyModule_Helper</class>
</mymodule>
</helpers>
I have a class file in app/code/local/MyCompany/MyModule/Helper/Custom.php
I get the error:
Fatal error: Class 'Mage_Custom_Helper_Data' not found
What went wrong?
You need to specify other helper classes in a particular module as sub-paths to your module helper's shortname. This is similar to how blocks and models work - but at the topmost level there is no subfolder.
I fix this error by referencing my Custom.php helper class file as such:
$helper = Mage::helper('mymodule/custom');
Self-help desk strikes again. When I un-tarred the new Magento codebase onto the old Magento codebase when updating the system, the file permissions on the
var
var/cache
directory where changed such that my local web server couldn't write to this folder.
When this happens, Magento silently uses your computer's var
and/or tmp
directory space to store the cached files. Specifically, it chooses the system var
dir here
#File: app/code/core/Mage/Core/Model/Config/Options.php
public function getVarDir()
{
//$dir = $this->getDataSetDefault('var_dir', $this->getBaseDir().DS.'var');
$dir = isset($this->_data['var_dir']) ? $this->_data['var_dir']
: $this->_data['base_dir'] . DS . self::VAR_DIRECTORY;
if (!$this->createDirIfNotExists($dir)) {
$dir = $this->getSysTmpDir().DS.'magento'.DS.'var';
if (!$this->createDirIfNotExists($dir)) {
throw new Mage_Core_Exception('Unable to find writable var_dir');
}
}
return $dir;
}
So, despite my clearing out of var/cache
, Magento was still loading the cached configuration from 1.6.0.0 configuration. This version of Magento had no request_rewrite
node, which is what led to the error.
Best Answer
There is an element in one of your
system.xml
files that has the typecolor
. This shouldn't be there by default so either you add it or there is an extension that did.Search in your
system.xml
files for this piece of text:and remove the field or change the type to
text
.