Hi, in function _uc_addresses_db_add_address is: $aid = db_next_id('uc_addresses'); ... I had problem with creating new addresses and i found problem there... it should by so: $aid = db_next_id('{uc_addresses}_aid'); by http://api.drupal.org/api/function/db_next_id/5 ... now it works fine for me ... (it works fine in general maybe, but i have done some special data transfers -> creating of users address books through theirs addresses in uc_orders table and so start happend some collisions probably (sorry for my english))

Comments

Miteto’s picture

I believe this is the "culprit" for me - since I don't use the billing address pane (it's hidden) and when i review the order then I press back button, the last used address gets duplicated. After I changed $aid = db_next_id('uc_addresses'); to $aid = db_next_id('{uc_addresses}_aid'); I get a warning for "Duplicate entry ..." but no duplication of addresses.

freixas’s picture

Assigned: Unassigned » freixas
Priority: Minor » Normal

Hey, guys, thanks for reporting this! The error was due to my lack of familiarity with some of the subtler points of Drupal.

Unfortunately, if I make this change, it will screw up any existing installations. I need to review how to do a database update: I have to copy the old sequence number to the new sequence number. It'll take me a little bit of time to figure out the right syntax and test it, so I'll be a bit delayed.

For most people, this shouldn't affect anything. As far as I can tell, all Drupal cares about is that the name identifying the sequence is unique.

As for error with "Duplicate entry...", that was a bug fixed a while back. You may want to update to RC3.

freixas’s picture

OK, I fixed this. Hopefully, the database update will run properly - it seemed to work for me. It should delete the old sequence number, but copy the value to the new sequence number.

The fix is in RC4, just released.

freixas’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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