Magento 1.7 - getModel in script outside web application fails

后端 未结 7 1949
猫巷女王i
猫巷女王i 2021-01-17 04:31

    
        
            Starmall_Shipment_Model
            s         


        
7条回答
  •  感动是毒
    2021-01-17 05:12

    Why does it prepend Mage in front of the model? What can be wrong in my config?

    To see, where this is happening, look at Mage_Core_Model_Config::getGroupedClassName():

        if (empty($className)) {
            if (!empty($config)) {
                $className = $config->getClassName();
            }
            if (empty($className)) {
                $className = 'mage_'.$group.'_'.$groupType;
            }
            if (!empty($class)) {
                $className .= '_'.$class;
            }
            $className = uc_words($className);
        }
    

    This can mean one of two things:

    1. The $config node was not found (global/models/starmall_shipment)
    2. The node has no class or model child or it is empty

    In your case it looks like (1), so the question remains, why is your config not loaded. You assured that the config itself is correct, so the problem must be that the module is not loaded.

    Can you post your module declaration file from app/etc/modules?

提交回复
热议问题