Magento Forum

   
[Solved] Object of class could not be converted to string
 
josh48202
Jr. Member
 
Total Posts:  26
Joined:  2010-02-02
 

I am overriding Mage_Sales_Model_Order and in my system.log file i am getting this error.

I followed this tutorial
http://magento4u.wordpress.com/category/class-override/model-override/

Recoverable ErrorObject of class GlowInd_Sales_Model_Order could not be converted to string  in /var/www/clients/client1/web2/web/lib/Varien/Db/Adapter/Pdo/Mysql.php on line 2686

My Order.php is just copied and pasted from the original Mage Core File.

this is my app/code/local/GlowInd/Sales/etc/config.xml file

<?xml version="1.0"?>
<config>
    <
modules>
        <
GlowInd_Sales>
            <
version>0.1.0</version>
        </
GlowInd_Sales>
    </
modules>

    <global>
        <
models>
            <
sales>
                <
rewrite>
                    <
order>GlowInd_Sales_Model_Order</order>
                </
rewrite>
            </
sales>
        </
models>
    </global>
</
config>

 
Magento Community Magento Community
Magento Community
Magento Community
 
luciddreams
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2011-08-25
 

This should work. Are You sure You don’t have some extra code inside Your class? It looks like You are passing object (without toString method) instead of string.

 
Magento Community Magento Community
Magento Community
Magento Community
 
josh48202
Jr. Member
 
Total Posts:  26
Joined:  2010-02-02
 

duhhhh silly me. I forgot to change the extends class from Mage_Sales_Model_Abstract to Mage_Sales_Model_Order. no more error. =]

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top