We upgraded from 6.x-2.0-rc3 -> 6.x-2.0-rc5 this morning, and this morning my store admins noticed the following errors on /admin/store/orders/[$foo] when the products ordered contained attributes:

warning: Invalid argument supplied for foreach() in /var/www/sites/all/modules/ubercart/uc_attribute/uc_attribute.admin.inc on line 933.

On that page, any item with attributes has a blank space where the attribute should be.

The attribute does exist and is saved properly; the attributes show up properly in emails as well as on /admin/store/orders/[$foo]/invoice.

I'm attaching screenshots of /admin/store/orders/[$foo] and /admin/store/orders/[$foo]/invoice

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dadderley’s picture

I updated today as well on a sandbox site.
I have Attributes enabled but I do not have any attributes set up for products.
When I go to view a sales report at "/admin/store/orders/16" I get this error message:
warning: Invalid argument supplied for foreach() in /Applications/MAMP/htdocs/member/sites/all/modules/ubercart/uc_attribute/uc_attribute.admin.inc on line 933

melon’s picture

I can confirm this after upgrading from rc3 to rc5 in my sandbox.

Island Usurper’s picture

Status: Active » Needs review
FileSize
829 bytes

I see, that's from order products' attributes from before checkboxes were allowed. The code that generates the description there assumes that there can be multiple options in an array, so the simplest fix is to make sure it gets an array, even if there's only one thing in it.

I've also taken the liberty of fixing the goofy output that was causing the list of attributes to have commas in the wrong places.

melon’s picture

Thanks Lyle, I applied the patch and it seems to work fine for me.

Island Usurper’s picture

Status: Needs review » Fixed

Cool deal. Thanks, melon. Committed.

Status: Fixed » Closed (fixed)

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

anthony0perez’s picture

Version: 6.x-2.0-rc5 » 6.x-2.9
Component: Code » Orders
Assigned: Unassigned » anthony0perez

I just wanted to know how you got this to work as I need it for a project im working on. Im using drupal 6 ubercart 6.x 2.9 and Dropdown attributes 1.4 and this seems to be the same issue that im having but when I check the code it looks like your patch so I dont know what else to do.

If you cant point me in the right direction that would be great.

inteldesk’s picture

Priority: Normal » Critical
Status: Closed (fixed) » Active

Same issue, just upgraded to 2.9 and chosen attributes no longer show on invoice

inteldesk’s picture

Same issue, just upgraded to 2.9 and chosen attributes no longer show on invoice

inteldesk’s picture

Assigned: anthony0perez » Unassigned
TR’s picture

Version: 6.x-2.9 » 6.x-2.0-rc5
Component: Orders » Code
Priority: Critical » Normal
Status: Active » Closed (fixed)

The probability that your issue is related to this issue that has been closed and fixed for three years is exactly 0%. And even if it were, this is in no way a "critical" issue - read the priority guidelines. Please open a new support issue with the specific details of your situation with instructions for how to reproduce the problem you're seeing. And please make an effort to debug your problem first - for example turn off "Dropdown attributes" or any other contributed modules you might have which affect attributes. If this can't be reproduced with core Ubercart and the default invoice template, then it's not a problem with core Ubercart.

trobey’s picture

Assigned: Unassigned » trobey
Status: Closed (fixed) » Active

I maintain Dropdown attributes and this is indeed a problem. From a client:

I'm not sure if this has anything to with your modules at all, but I just did an upgrade of [the] site to the latest versions of ubercart, core and a few other non-ecommerce related items... D6. Now the item attributes do not show up on the order invoice. They show up in the cart, but if I view the order under store admin/orders/view order, only one attribute shows up... the text field.

...

I tried 3 different recommended modules and had to go back to 6.2x.dev from last year. I saw one issue regarding this issue, http://drupal.org/node/553668. If you look towards the bottom you'll see new posts from Aug 2012. I just haven't had time to install on my dev server to test.

When I review an order with the latest 6.x release I get the following error message:

Notice: Undefined offset: 0 in uc_dropdown_attributes_order_product_alter() (line 326 of /var/www/dropdown6/sites/all/modules/uc_dropdown_attributes/uc_dropdown_attributes.module).

This is very strange since I have not changed any of the associated code in Dropdown attributes in a very long time. I installed Ubercart 6.x-2.7 from last year and I do not get an error.

The current release of Ubercart has the following structure for the product object:

product->data['attributes']['Size'][1] = 'Small'

Ubercart 6.x-2.7 has the following structure for the product object:

product->data['attributes']['Size'][0] = 'Small'

Instead of numbering starting at zero it appears the attribute id is being used. I will update Dropdown attributes to fix the problem introduced by Ubercart.

There is a problem with the attributes showing up in order page and I have not traced it down yet but since none of the associated code in Dropdown attributes has changed in a long time and it was working the cause is likely Ubercart.

I have also filed an issue in the Dropdown attributes issue queue #1867598: Ubercart changes the product object structure and breaks Dropdown attributes.

trobey’s picture

This problem has been fixed by changing the code in Dropdown attributes to handle the new product object structure. In fact, the fix involved completely removing the code since the "hidden" attributes that have no selected option are no longer appearing in the order. See #1867598: Ubercart changes the product object structure and breaks Dropdown attributes.

trobey’s picture

Status: Active » Closed (fixed)