diff --git a/location.module b/location.module index 1062d78..b8a2c73 100644 --- a/location.module +++ b/location.module @@ -1336,12 +1336,16 @@ function _location_country_ajax_callback($form, $form_state) { $location_path = $form_state['triggering_element']['#array_parents']; array_pop($location_path); $location_field = drupal_array_get_nested_value($form, $location_path); - $province = $location_field['province']; + if (isset($location_field['province'])) { + $province = $location_field['province']; - // Set new options from triggering element value. - $province['#options'] = array('' => t('Select'), 'xx' => t('NOT LISTED')) + location_get_provinces($country_field['#value']); + // Set new options from triggering element value. + $province['#options'] = array('' => t('Select'), 'xx' => t('NOT LISTED')) + location_get_provinces($country_field['#value']); - return $province; + return $province; + } + + return array(); } /**