Attributes problems with vertion 5.x-1.0-rc4

Posts: 16
Joined: 05/06/2008

Hi!
I installed Ubercart for the first time and I love it but right now I have a little problem with attributes.
First, when I set up attributes in a select box or with radio buttons, I have a text field instead... Which is very annoying because these attributes are required to compete the order.
Second problem is, when I try sur delete an attribute I have a n error message :

* user warning: Not unique table/alias: 'co' query: DELETE FROM co USING uc_class_attribute_options AS co, uc_attribute_options AS ao WHERE co.oid = ao.oid AND ao.aid = 2 in /homepages/14/d239557980/htdocs/mysite/includes/database.mysql.inc on line 172.
* user warning: Not unique table/alias: 'po' query: DELETE FROM po USING uc_product_options AS po, uc_attribute_options AS ao WHERE po.oid = ao.oid AND ao.aid = 2 in /homepages/14/d239557980/htdocs/mysite/includes/database.mysql.inc on line 172.
* user warning: Not unique table/alias: 'pd' query: DELETE FROM pd USING uc_product_adjustments AS pd, uc_product_attributes AS pa WHERE pd.nid = pa.nid AND pa.aid = 2 in /homepages/14/d239557980/htdocs/mysite/includes/database.mysql.inc on line 172.

Still the attribute is deleted but I am worried beacaus it could create conflicts and other bugs

The same thing hapens if I try to delete an option of my attribute :

user warning: Not unique table/alias: 'ao' query: DELETE ao, co, po FROM uc_attribute_options AS ao LEFT JOIN uc_product_options AS po ON ao.oid = po.oid LEFT JOIN uc_class_attribute_options AS co ON ao.oid = co.oid WHERE ao.oid = 4 in /homepages/14/d239557980/htdocs/mysite/includes/database.mysql.inc on line 172.

The option is not deleted but I can edit it or add a new one.

Is there a patch or some php code to fix the bug?
Thans for your help. Bee

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

After you put attributes on a product, you have to enable the options too. I know it seems silly if you plan on using all of the options for every attribute, but not everyone does that.

What version of MySQL are you using? There's some weirdness with the way older versions handle multi-table DELETE statements.

Posts: 16
Joined: 05/06/2008

Hi Lyle, thanks for helping me! I use Mysql 4.0.27 and drupal 5.
For the options how do you enable them? I thought ( since I could add options to my attributes ) that there was nothing else to do...
Note :
I folowed this tutorial to create my attributes :
http://www.ubercart.org/docs/user/3340/product_attributes_and_options

Thanks
Bee

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

This part here is what I was thinking of (emphasis mine):

Quote:
Assigning attributes and options to products:
...
5. Now click on the Options tab.
6. Here you will see a table for each attribute you have assigned to this product. It contains a listing of all the options associated with these attributes. For each option, you must check its box to enable it for this product and then verify that the values set are correct for this product. Here you may override the defaults and not affect any other product.
...

In other news, your database version uses the old style of DELETE statements. Unfortunately, I think they're mutually incompatible, which is a terrible mistake on somebody's part.

Posts: 16
Joined: 05/06/2008

So this means that I can't use attributes... Hum this is a big problem.
If I upgrade Mysql to Mysql5 is there a chance for me to avoid this problem?

Thanks
Bee

Posts: 16
Joined: 05/06/2008

Well finally I upgraded to MYSQL-5 and now it works.
But changing from Mysql4 to Mysql5 takes time and depending on your host it's not that easy. I wonder if there is a warning in ubercart documentation about compatibility with the server issue.

Thanks for helping
Bee

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

The installation documentation does mention 4.1 as a minimum requirement, though I think it wouldn't be a bad idea to encourage 5+ more strongly. I'll bookmark this to my documentation to-do so we can get a concise list of requirements up.

Posts: 16
Joined: 05/06/2008

Thanks Ryan!

********^_^****