Steps to reproduce

1) Submit address with "NOT LISTED" selected for province.
2) Return to form and look at the options list

Problem

"NOT LISTED" is not the default value.

Expected Behavior

When the user has previously selected "NOT LISTED", this default value should be displayed.

Possible Cause

The function location_api2form() deletes $translated['province'] by not having an else statement for when $location['province'] == 'xx'.

In HEAD:

function location_api2form($location = array()) {
  $translated = array();
  foreach ($location as $key => $value) {
    if ($key == 'province') {
      if (strlen($value) && isset($location['country']) && strlen($location['country']) && $location['province'] != 'xx' && $location['country'] != 'xx') {
        $translated['province'] = $location['country'] .'-'. $value;
      }
    }
    else {
      $translated[$key] = $value;
    }
  }
  return $translated;
}

Comments

bdragon’s picture

Err, what's still calling that in HEAD?

I'm trying to remove that function....

raspberryman’s picture

Hi bdragon - I just verified the function existed in HEAD, I did not test HEAD. Pardon my jump to conclusions :) My bad.

bdragon’s picture

Status: Active » Fixed

Commented the functions out. ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

cerup’s picture

Status: Closed (fixed) » Active

Where is this function? It still seems to be an issue where 'not listed' isn't saved for state/province field.

yesct’s picture

Status: Active » Postponed (maintainer needs more info)

@cerup please add more details about what the current problem is.

Please check to see if this is still a problem in the new release. If it is, reply with a new summary and set the status back to active.

ankur’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing due to lack of follow up.