Mukesh
Mukesh

Reputation: 7778

On clicking a custom tab in Magento admin,Invalid config field backend model

I have module a module as Mak_Gift there I am creating a custom tab.(Mak is namespace and Gift is module name.)

When I click the tab created in the Magento admin, I am getting following error

Invalid config field backend model: gift/system_config_backend_date

I have created the system.xml file with following code

....

<backend_model>gift/system_config_backend_date</backend_model>

.... 

I have the Date.php file at following location

app\code\local\Mak\Gift\Model\System\Config\Backend\Date.php

class Mak_Gift_Model_System_Config_Backend_Date extends Mage_Core_Model_Config_Data
{
     protected function _beforeSave()
    {
    }
}

config.xml

<global>
    <models>
        <mak_gift>
            <class>Mak_Gift_Model</class>
        </mak_gift>
    </models>
</global>

What is wrong with my code?

Upvotes: 0

Views: 843

Answers (2)

Girish Hosamani
Girish Hosamani

Reputation: 1203

Or else you change

 <global>
    <models>
        <mak_gift>
            <class>Mak_Gift_Model</class>
        </mak_gift>
    </models>
</global>

To

    <global>
    <models>
        <gift>
            <class>Mak_Gift_Model</class>
        </gift>
    </models>
</global>

Upvotes: 1

Marius
Marius

Reputation: 15206

Declare your backend model like this:

<backend_model>mak_gift/system_config_backend_date</backend_model>

Upvotes: 1

Related Questions