1

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

5

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
{
}
  • So Can I check condition in model to include class according to version in Magento – Pankaj Pareek Jul 24 '13 at 11:15
  • I've edited the answer. – Marius Jul 24 '13 at 11:19
  • Is this right class 'Mage_Core_Model_Resource_Setup' that extend setup class of any custom module. I have added all my table sql in run function. but its not created. previously it was working fine in magento 1.7.0.2 – Pankaj Pareek Jul 25 '13 at 7:27
1

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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