Urgent - core_commerce issue saving to DB
Permalink
Hi all,
I'm currently working on my second Concrete 5 site. I'm a seasoned PHP developer, but a Concrete 5 n00b.
The first project was writing a custom payment integration / payment mmethod for core_commerce. This is working well on site 1.
So we copy the same core_commerce files and the same new extension across to site 2.
After entering shipping details, we get the following fatal error (this doesn't happen on site 1)...
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /PATH/TO/concrete/libraries/3rdparty/adodb/drivers/adodb-mysql.inc.php on line 140
I do a dump of the data it's trying to insert into the DB...
Array ( [label] => GST [type] => + [value] => 2.81 )
The ADODB class is expecting a string, not an array, hence the error.
Earlier, the data we in relation to shipping type, now it's in relation to tax.
This is happening when $order->setAttribute() is called.
I have been trolling back and forwards through the classes using debug_backtrace trying to find the bug / issue, but I'm just not familiar with the C5 structure to know whether it looks right or not. core_commerce clearly wants to save an array into the object, but this causes issues when it's saved to the DB because it's not being serialized.
Anyone know why this error might be appearing? Anyone able to offer some urgent assistance on this? I have spent many many hours but don't seem to be making progress, and the client needs the site working.
Any assistance appreciated.
I'm currently working on my second Concrete 5 site. I'm a seasoned PHP developer, but a Concrete 5 n00b.
The first project was writing a custom payment integration / payment mmethod for core_commerce. This is working well on site 1.
So we copy the same core_commerce files and the same new extension across to site 2.
After entering shipping details, we get the following fatal error (this doesn't happen on site 1)...
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /PATH/TO/concrete/libraries/3rdparty/adodb/drivers/adodb-mysql.inc.php on line 140
I do a dump of the data it's trying to insert into the DB...
Array ( [label] => GST [type] => + [value] => 2.81 )
The ADODB class is expecting a string, not an array, hence the error.
Earlier, the data we in relation to shipping type, now it's in relation to tax.
This is happening when $order->setAttribute() is called.
I have been trolling back and forwards through the classes using debug_backtrace trying to find the bug / issue, but I'm just not familiar with the C5 structure to know whether it looks right or not. core_commerce clearly wants to save an array into the object, but this causes issues when it's saved to the DB because it's not being serialized.
Anyone know why this error might be appearing? Anyone able to offer some urgent assistance on this? I have spent many many hours but don't seem to be making progress, and the client needs the site working.
Any assistance appreciated.
Thanks for the quick response, though these don't seem to help.
I did notice that removing the default shipping module we get a different type of fatal error...
Fatal error: Call to a member function getLineItemName() on a non-object in /PATH/TO/packages/core_commerce/elements/cart_item_list.php on line 85
I'll need to look into this one further.
I did notice that removing the default shipping module we get a different type of fatal error...
Fatal error: Call to a member function getLineItemName() on a non-object in /PATH/TO/packages/core_commerce/elements/cart_item_list.php on line 85
I'll need to look into this one further.
Refresh your database schema:
Dashboard -> Sitewide Settings -> Refresh Schema - do both core & custom. Sometimes db formats get messed on the import/export
While your on that page, Disable cache and hit the clear cache button. Whenever I move sites the cache files get copied over and always cause trouble in a new environment. You can also delete them manually to be 100% sure:
rm -Rf files/cache/* files/cache_objects/*
Take a close look at your php settings & mysql versions/settings
Remove your shipping add-on, then try checkout again.