location.module forget to remove country code in province code before saving user location in the DB.

So in the user edit form, the 'province' selectable list never retrieves the saved value.

Sorry but I don't have time to do a patch, but to fix this bug:
in location.module file, in "location_user" function add

    if ($user_setting != LOCATION_USER_CIVICRM_ONLY)
    {
      $edit['location'] = location_form2api($edit['location']);
    }

before

    _location_save($edit['location'] ? $edit['location'] : array(), $user, 'user');

note: I tested that on a non-CIVICCRM drupal.
"location_user" function alter the province code according to the CIVICCRM database before saving it , so this bug may not exist with drupal running under CIVICCRM. We may have to run location_form2api function only with non-CIVICCRM drupal. I'm waiting for feedback on this...

Comments

pitpit’s picture

Version: 6.x-3.x-dev » 4.6.x-1.x-dev

sorry, not tested on CVS buton 4.6.3

bdragon’s picture

Status: Active » Closed (fixed)

This section of code is going away.