I get these errors when using Google Checkout. The other payment methods are fine.
Illegal offset type in xxx/sites/all/modules/ubercart/uc_cart/uc_cart.module on line 1369.
(same error for lines 1368, 1337, 1334)
Invalid argument supplied for foreach() in xxx/sites/all/modules/ubercart/uc_cart/uc_cart.module on line 1588.
A peek at the code identifies $items and its element $items[cid] as the common problem.
The first error on the list (maybe the first error thrown, but who knows?) is at line 1369, and that is in function uc_cart_get_contents. All the offset type errors are in that module. My suspicion is that when we go to Google Checkout, the cart contents have not yet been properly grabbed.
According to the log, my transactions ARE being processed, and I see them in Google Checkout (albeit without order details), so I'm not losing money, but this does seem to be a bug. If it's been fixed in 2.0, that's great, as I plan to install it with patches next week, but in the meantime, I have shut down GC out of caution.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | ubercart.patch | 1.81 KB | rolodmonkey |
Comments
Comment #1
chazz commentedSame story here with 6x.2.2 , I noticed errors in recent log entry section:
Payment received fine, but I don't know if customer can see this errors as well
Comment #2
rolodmonkey commentedI am getting the same behavior. In version 6.x-2.2, the line for the first error has changed to 1337 in uc_cart.module.
This is definitely happening when a customer makes it over to Google Checkout but I'm not sure it is directly related to that module. Another clue is that I got a blank email after the customer finished checking out.
I am going through the code and trying to backtrack through all of the places that uc_cart_get_contents() is called, but I really hope that someone else might already have a good idea about where this is happening.
Comment #3
rolodmonkey commentedOkay, I found the problem.
I have to admit that I'm a little frustrated because it turned out to be the same problem that I tracked down last year:
http://www.ubercart.org/comment/42099
This time, I have gone as far as to create a patch of my fixes. I would really appreciate it if someone could get this patch into the next release.
Comment #4
rolodmonkey commentedComment #5
chazz commentedThanks! Applied the path, will see if it's work when I'll get an order.
Is it possible to test it somehow?
Comment #6
rolodmonkey commentedYou should set up a Google sandbox account for testing purposes. Then, you should switch to test mode in the Ubercart Google Checkout settings and put in the Merchant ID and Key for the sandbox. That way you can run as many tests as you need without creating any real transactions.
Comment #7
chazz commentedJust received new order via Google Checkout today, but I can't see ANY action in log files. User account has been created, stock has been decreased, google checkout is marked as paid (also on ubercart) but there is none information in website admin recent log file. It should be at least note about new user account or new order.
So looks like path nr. 3 is working so far, no error after update, thanks!
Comment #8
thill_ commentedThis needs a bump and a review as it is still an issue in the current dev version.
Comment #9
thill_ commentedThis corrects issues with current dev and google API 2.4.
Comment #10
tr commentedCommitted. Thanks.