5

I am at a loss, I've tried a lot of stuff but nothing seems to work to get rid of this error.

Fatal error: Call to a member function beginTransaction() on a non-object in /home1/powertg2/public_html/app/code/core/Mage/Core/Model/Abstract.php on line 313

What I am trying to accomplish it to submit an RFQ form with simple data and save results to a database.

Power/Rfq/etc/config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Power_Rfq>
        <version>0.0.1</version>
    </Power_Rfq>
</modules>
<frontend>
    <routers>
        <rfq>
            <use>standard</use>
            <args>
                <module>Power_Rfq</module>
                <frontName>submit-rfq</frontName>
            </args>
        </rfq>
    </routers>
    <layout>
        <updates>
            <submitrfq>
                <file>rfq.xml</file>
            </submitrfq>
        </updates>
    </layout>
</frontend>
<global>
    <models>
        <rfq>
            <class>Power_Rfq_Model</class>
            <ressourceModel>rfq_mysql4</ressourceModel>
        </rfq>
        <rfq_mysql4>
            <class>Power_Rfq_Model_Mysql4</class>
            <entities>
                <submitrfq>
                    <table>submitrfq</table>
                </submitrfq>
            </entities>
        </rfq_mysql4>
    </models>

    <resources>
        <rfq_setup>
            <setup>
                <module>Power_Rfq</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </rfq_setup>
    </resources>

    <helpers>
        <rfq>
            <class>Power_Rfq_Helper</class>
        </rfq>
    </helpers>
</global>

Power/Rfq/controller/IndexController.php

// Save the customer to the database
$rfq = Mage::getModel('rfq/submitrfq');
$rfq->setData('first_name', $post['first_name']);
// Other set data

$rfq->save();

Power/Rfq/Model/Submitrfq.php

class Power_Rfq_Model_Submitrfq extends Mage_Core_Model_Abstract
{
    public function _construct()
    {
        $this->_init('rfq/submitrfq');
    }
}

Power/Rfq/Model/Mysql4/Submitrfq.php

class Power_Rfq_Model_Mysql4_Submitrfq extends Mage_Core_Model_Mysql4_Abstract
{
    public function _construct()
    {
        $this->_init('rfq/submitrfq', 'submitrfq_id');
    }
}

Power/Rfq/Model/Mysql4/Submitrfq/Collection.php

class Power_Rfq_Model_Mysql4_Submitrfq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
{
    public function _construct()
    {
        $this->_init('rfq/submitrfq');
    }
}

This is for Magento 1.9. I am able to call other Model functions like getCollections(); but this one just isn't working.

Any and all help appreciated. Thank you.

4

Ok well the French in me came out.

<ressourceModel>rfq_mysql4</ressourceModel>

To change to

<resourceModel>rfq_mysql4</resourceModel>

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.