Hello - I was checking a log file tonight for a site I have running 3.4, and noticed I have thousands of these notices:

PHP Notice: Undefined index: q in /modules/ecommerce/cart/cart.module on line 117

Looked at the code in line 117 for cart_exit() -- it is pretty much unchanged in version 4 alpha 10 also. I think I'd still be getting these. Often the referrer in the error is from a search query... like http://localsearch.live.com/localsearch/details.aspx?lid=YN926x15807359&...

I modified line 117 from:
if (strstr($_GET['q'], 'cart/view') && $user->uid == 0 && variable_get('cache', 0)) {

to:
if ( arg(0) == 'cart' && $user->uid == 0 && variable_get('cache', 0)) {

See any issue in doing this? Seems to have fixed the notices I was getting.

Thanks
-Greg

Comments

theorichel’s picture

I have the same message in my error logs. I think I am going to change it like you