I have a module:


class NAME_CustomField_Model_SelectType
  public function toOptionArray()
    return array(
      array('value' => '1', 'label' => '1'),
      array('value' => '2', 'label' => '2'),
      array('value' => '3', 'label' => '3'),

in my etc/config.xml I have:


Now, if I set in the DB (table: eav_attribute) source_model to: customfield/selectType it gives an error: Source model "customfield/selectType" not found.

UPDATE: I've moved my file to: "code/core/Mage/Customer/Model/Customer/Attribute/Source" (for testing ofcourse) and changed the resource model to: customer/customer_attribute_source_selecttype This works, so I think there is something in my /etc/*.xml that is wrong, but I can't seem to find what it would be... :-S

  • I'm really surprised that this would work in any place. I think that EAV source models are expected to implement Mage_Eav_Model_Entity_Attribute_Source_Interface and/or subclass Mage_Eav_Model_Entity_Attribute_Source_Abstract.
    – benmarks
    Commented Sep 11, 2013 at 10:10
  • Check in the backend System > Config > Advanced whether your module is in the list, if it is, then the Module_Xml.xml in app/etc/modules is loaded. Next check: make a typo in your config.xml if display_errors and developer mode is on, then you should see an error, if not config.xml is not loaded. If this all works, I have no idea, why the source model is not found. Commented Nov 10, 2013 at 22:38
  • Did you solve your problem? Please share the solution with us. Commented Mar 10, 2014 at 20:50

2 Answers 2


Your XML looks correct — although if Magento's loading the class from the Mage namespace that may be because your XML hasn't been loaded into the global configuration tree (cached XML, incorrect app/etc/modules file).

Your best bet is to debug things at the point where Magento looks into the configuration for your new class name

#File: app/code/core/Mage/Core/Model/Config.php
public function getGroupedClassName($groupType, $classId, $groupRootNode=null)
    $config = $this->_xml->global->{$groupType.'s'}->{$group};
    $className = null;
    if (isset($config->rewrite->$class)) {
        $className = (string)$config->rewrite->$class;
    } else {

Figure out why Magento can't find your base classname in the XML configuration, and you'll have your problem solved.

  • thanks for your answer I will definitely try this, if the answer to my problem is worth mentioning I will mention it here. Commented Aug 12, 2013 at 8:38
  • @bvl Also, I generally avoid camel casing and inter-casing classnames like that (SelectType). To easy for the autoloader to get confused about w/r/t to class case. Commented Aug 12, 2013 at 16:08
  • @bvl Any luck here? Commented Aug 14, 2013 at 3:29
  • 1
    no, not yet, but I actually think the camel casing is the issue... Commented Aug 14, 2013 at 16:21
  • @bvl Based on what you've posted, you have the correct information in place to make the camel-cased class work (correct class argument, correct filename).
    – benmarks
    Commented Sep 11, 2013 at 10:06

I guess the problem is here "DB (table: eav_attribute) source_model to: customfield/selectType"
It should be customField/selectType

  • This is wrong. The module before the / must be the same as the node in the xml, so customfield is correct. Commented Nov 10, 2013 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.