Needs review
Project:
Reorder button for Ubercart
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2010 at 16:14 UTC
Updated:
11 Dec 2012 at 20:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
jm.federico commentedPatch file
Comment #2
jm.federico commentedComment #3
tr commentedWhat error do you get? I don't see any error when I test with a product that has no attributes. Are you using PHP 5.3?
Comment #4
jm.federico commentedHi, I get:
warning: Invalid argument supplied for foreach() in /modules/uc_reorder/uc_reorder.module on line 95.
the problem only occurs when the attributes module is not enabled.
What happens is that $product->data['attributes'] is added to the product by the attributes module.
If no attributes are set for a product, its $product->data['attributes'] property will be empty, but will exist.
If the module is not installed $product->data['attributes'] will never be set, and that is when you get the error.
Disable and uninstall the module, you will get the error. (Or try on a new install)
Using php 5.2.9
Federico
Comment #5
jm.federico commentedHere is another options, in this one I use module_exists(). Haven't tested it thoroughly, as I said, I am not using the attributes module.
Cheers
Comment #6
jm.federico commentedAny updates?
Comment #7
calbasiHello,
I've got this issue too :-p
Comment #8
elektrorl commentedPatch #2 works fine for me.