This is an easy one. What happens is the module assumes we are using attributes with our products, and when we are not (I am not) an error occurs.

Attaching patch that checks if the products has attributes before processing them.

Comments

jm.federico’s picture

StatusFileSize
new2.56 KB

Patch file

jm.federico’s picture

Status: Active » Needs review
tr’s picture

What 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?

jm.federico’s picture

Hi, 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

jm.federico’s picture

StatusFileSize
new2.56 KB

Here 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

jm.federico’s picture

Any updates?

calbasi’s picture

Hello,
I've got this issue too :-p

elektrorl’s picture

Patch #2 works fine for me.