After upgrade from 6.x-2.4 to 6.x-2.6 checkout fails with:

If I use Paypal Express Checkout:
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/nimic/public_html/includes/database.mysqli.inc on line 329.
Error message from PayPal:
The field Shipping Address1 is required

If I use Authorize.net CC:
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/nimic/public_html/includes/database.mysqli.inc on line 329.

In the case of PayPal, the order returns to the checkout page. In the case of a CC checkout, the checkout appears to complete and sends out order confirmation emails. If I view an order with either payment method, the payment received field is "pending" and the shipping / billing addresses are "UNKNOWN." The transactions are not being processed by Authorize.net or PayPal.

I have a full backup and will most likely be reverting soon. But if anyone has any suggestions or files they would like me to collect to help. Please let me know.

Comments

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

Something is trying to write an array instead of a string to the database, but from a quick glance through the code I can't see where that could be, and without a backtrace it's impossible to diagnose further from that error message alone unfortunately.

So you can complete the checkout page, and the review order screen shows up correctly including the addresses? But then when you finally submit the order, this warning shows up, and the order details have been lost?

dzepol’s picture

I found this same problem on my site. Disabling modules revealed it seemed to be related to the Ubercart Mailchimp module. Two issues below related to the problem.

#1218872: UC Mailchimp appears to be cause of error found here, mysql_real_escape_string() expects parameter 1 to be string

See this issue for a potential fix: #1242030: An update of uc_mailchimp (add interest groups, merge vars, tidy up review order and fix mysql_real_escape_string() error)

nimicohgr’s picture

Thanks for your help everyone. I can confirm the problem was UC Mailchimp. I did not feel comfortable making any major changes, so I just applied the fix for mysql_real_escape_string() as copied in below. It's a one liner.

--- uc_mailchimp.module.orig 2009-12-17 01:00:00.000000000 +1100
+++ uc_mailchimp.module 2011-08-17 13:58:03.000000000 +1000
@@ -118,7 +118,7 @@
         return $review;
     break;
     case 'process':
-        $arg1->uc_mailchimp = $arg2;
+        $arg1->uc_mailchimp = serialize($arg2);
       
     break;
     case 'settings':
nimicohgr’s picture

Assigned: Unassigned » nimicohgr
Status: Postponed (maintainer needs more info) » Closed (fixed)
nyleve101’s picture

Status: Closed (fixed) » Active

Hi,

I am also experiencing the issues outlined by nimicohgr:

"warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/nimic/public_html/includes/database.mysqli.inc on line 329.

In the case of PayPal, the order returns to the checkout page. In the case of a CC checkout, the checkout appears to complete and sends out order confirmation emails. If I view an order with either payment method, the payment received field is "pending" and the shipping / billing addresses are "UNKNOWN." The transactions are not being processed by Authorize.net or PayPal."

I am not however using UC Mailchimp.

Does anyone have any idea what the issue might be?

longwave’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Something is trying to write an array instead of a string to the database, but without a backtrace it's impossible to diagnose further from that error message alone unfortunately.

Try disabling any Ubercart contributed modules you may have, as the error is unlikely to be caused by Ubercart core. And are you really still using 6.x-2.6? Try upgrading to 6.x-2.7.

nyleve101’s picture

Hi,

i did a backtrace and it's coming from the multicurrency module. Thanks for your help.

longwave’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

klavs’s picture

#7: could you elaborate on where in the multicurrency module? would help me fix the problem for me as well.