Question

I am developing a magento extension with custom table access using v 1.7.0.2. Created package and Installed in another magento instance with 1.5.0.

I am able to install my extension in 1.5.0 also. When I access my table listing from admin menu, I get error "Fatal error: Class 'Mage_Core_Model_Resource_Db_Abstract' not found.

Mage\Core\Model\Resource\Db\Abstract.php is missing in magento1.5.1.0. Can somone help me how I can create module compatible to both version

Was it helpful?

Solution

In 1.5 the class that behaves as Mage_Core_Model_Resource_Db_Abstract behaves in 1.7 is Mage_Core_Model_Mysql4_Abstract.

Your model should extend Mage_Core_Model_Mysql4_Abstract in 1.5

[EDIT]
You can make you model extend Mage_Core_Model_Mysql4_Abstract for all versions because this class exists in 1.7 also for backwards compatibility and it looks like this.

abstract class Mage_Core_Model_Mysql4_Abstract extends Mage_Core_Model_Resource_Db_Abstract
{
}

OTHER TIPS

before Magento 1.6.0.0 only supported MySQL as a backend, so Mage_Core_Model_Resource_Db_Abstract simply doesn't exist .You can check this by browsing to root_magento_dir/app/core/Mage/Model/Resource folder.

http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-6-magento-setup-resources (check heading RDBMS Agnostic Scripts)

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top