When creating a new account or adding a new address, I get this error...

user warning: Unknown column 'address_name' in 'field list' query: INSERT INTO uc_addresses (aid, uid, first_name, last_name, phone, company, street1, street2, city, zone, postal_code, country, address_name, created, modified) VALUES

I assume I just need to create a column 'address_name' in uc_addresses table?

Thanks!

Comments

freixas’s picture

Assigned: Unassigned » freixas
Status: Active » Postponed (maintainer needs more info)

You should always run update.php after updating a module. Please run update.php and let me know if this fixes your problem.

ckenda1’s picture

That seemed to work only IF I installed 5.x-1.0 first and then upgraded. If I installed 5.x-1.x-dev or 5.x-2.0- first, it was broke.

ckenda1’s picture

On a second note..

When creating a new address with any country outside of the US, the zones load but when I select one and submit, it reverts to the US zones and says..

"An illegal choice has been detected. Please contact the site administrator."

Any idea what this is related to?

Thanks!

goodeit’s picture

I have encountered the same problem with a customer from Canada. This is on 1.0, will update to 2rc1 soon and check it out.

ckenda1’s picture

2rc1 does not fix the "An illegal choice has been detected. Please contact the site administrator." behavior...

freixas’s picture

Boy, you're fast!

I woke up this morning realizing that I had probably not updated the uc_addresses.install to handle a first time install. Also, I realized that I don't understand how Drupal knows which update to apply. So before I fix this, I need to better understand how the .install file should work.

As for the second problem, I'll try to find out what's going on there as well.

Thanks for reporting the problems and checking out some variants!

freixas’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, after some studying, I found out that on a schema change:

  1. I need to update the uc_addresses_install() to reflect the latest schema.
  2. That Drupal will look for the latest update number and, even though it doesn't apply the update, it will automatically record the schema as being updated for that version.

I've checked in the fix into CVS and it should show up in the dev build in a day or so.

As to the second problem, I was unable to duplicate it. My system has two countries enabled: US and Canada (US is the default). I was able to create a Canadian address with no problems. Could you look in your watchdog log? There should be a lot more detail there.

Also, I am marking this bug fixed. For the second problem, please open a new bug. Please provide more details about exactly where the new address was being created: during registration, during checkout or by using the "Add a new address" link in My Account. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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