Hiya,
I added a product attribute to a product then removed it. Decided it should have those attributes again and added it. The addition resulted in error messages like:
user warning: Duplicate entry '13-3' for key 1 query: INSERT INTO uc_product_options (nid, oid, cost, price, weight, ordering) VALUES (13, 3, 0, 0, 0, -10) in /srv/drupal-6/sites/all/modules/ubercart/uc_attribute/uc_attribute.admin.inc on line 626.
I'm guessing those records aren't removed so sold products and adjustments aren't compromised. So I suppose it's just the insertion code needs to check if those records exist already before doing the insert.
Posting it here in case someone else gets a chance to fix it before I do.
Comments
Comment #1
nchase commentedgetting something same when I add attributes, especiall when adding more than one:
user warning: in ubercart/uc_attribute/uc_attribute.admin.inc on line 626.
Comment #2
Island Usurper commentedArg. The queries that delete the options and the attribute have the values in different orders, and the attribute and node ids are almost never the same. Patch rearranges the arguments given to db_query() for those two DELETE statements.
Committed to repo, since it tested fine on my local sites.