I am seeing this error once every day or two in the watchdog on a fairly busy Ubercart 1.7 store:

Invalid argument supplied for foreach() in [...]/sites/all/modules/ubercart/shipping/uc_quote/uc_quote.module on line 1413

This occurs because the JavaScript callback at /cart/checkout/shipping/quote does not check if the POSTed variables are set before using them, though I don't know how this would occur during normal usage of the site. A patch is attached that wraps the affected code in an is_array() check.

CommentFileSizeAuthor
uc_quote.patch1.03 KBlongwave

Comments

longwave’s picture

Status: Active » Needs review
jju’s picture

Status: Needs review » Reviewed & tested by the community

Thnx

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Because I'm not entirely sure of the implications here, I simple casted $_POST['details'] to an array within that foreach(). I think it'll have the same outcome, it's just less of a patch at this point.

Status: Fixed » Closed (fixed)

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