All is in the title ! But for the search engine :

How to display the complete state/province of location cck field instead code ?

Comments

uprojects’s picture

So nobody has this problem !!!

vm’s picture

Status: Active » Postponed (maintainer needs more info)

I don't understand the question. What do you mean code?

When I select a state or province I don't see any code only the state or province I've chosen.

adulion’s picture

i have the same problem.. the thing is that the province in the db is being traimmed down to the first 3 charachters.. so its the insert code and not the display code

adulion’s picture

Status: Postponed (maintainer needs more info) » Active

what file contains the insert query for the actual province? am struggly with the mass of files

yesct’s picture

maybe related #366955: Japan Provinces Return Numbers, Not Abbreviations ???

#349647: Get Countryname ???

the location.xx.inc files might have something in them.

yesct’s picture

marked #409752: province as a duplicate of this issue

shenzhuxi’s picture

In 6.x-3.1-rc1, Just change the 19 line of location.tpl.php into:
$city_province_postal[] = ''. $province_name .'';

dboulet’s picture

Title: How to display the complete state/province of cck field instead code ?! » How to display the complete state/province name instead of abbreviation
Status: Active » Fixed

Thanks shenzhuxi, that did it. All one has to do is copy location.tpl.php to their theme folder and make the adjustment mentioned above.

yesct’s picture

tagging.

Glad this worked out for you.

Status: Fixed » Closed (fixed)

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

barry_fisher’s picture

If anyone is looking for a solution to make the full descriptions appear (instead of the state/province codes) on the node edit form then I found that you can alter this behaviour with hook_locationapi().

function mymodule_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
  switch($op) {
    case 'field_expand':
    switch ($a3) {
      /* other fields... */
      case 'province':
        drupal_add_js(drupal_get_path('module', 'location') .'/location_autocomplete.js');
        $country = $a5['country'] ? $a5['country'] : variable_get('location_default_country', 'us');
        return array(
          '#type' => 'textfield',
          '#title' => t('County/Province'), // My locations are mainly in the UK so this label makes more sense
          '#autocomplete_path' => 'location/autocomplete/'. $country,
            //'#default_value' => $obj,
          '#default_value' => location_province_name($a5['country'], $obj),
          '#size' => 64,
          '#maxlength' => 64,
          '#description' => t("This line will autocomplete. Please select an appropriate County/Province or leave it blank if you can't find one."),
          // Used by province autocompletion js.
          '#attributes' => array('class' => 'location_auto_province'),
          '#required' => ($a4 == 2),
        );
    /* other fields... */
    }
  }
}

Notice the old '#default_value' commented out with a new line calling the location_province_name() function.

Hope this helps someone.

Barry