When first selecting a country code for a node (e.g. Australia (+61)) and then editing the node, the selected country code is not the one associated with the node. It is the default country code specified in the content type's field configuration settings. Is it possible that if a node has a set value for country code that it can take precedence in being selected instead of the default country code?

Otherwise when editing nodes many times, if I forget just one time to reset the country code, then the value will not be accurate.

Comments

mizerydearia’s picture

Status: Active » Closed (duplicate)
mizerydearia’s picture

Status: Closed (duplicate) » Active

Actually, the other support request is for different version. Reopened.

mizerydearia’s picture

fix: See line 666

from: '#default_value' => isset($element['#value']['country_codes']) ? $element['#value']['country_codes'] : isset($field['default_country']) ? $field['default_country'] : NULL,

to: '#default_value' => isset($element['#value']['country_codes']) ? $element['#value']['country_codes'] : (isset($field['default_country']) ? $field['default_country'] : NULL),

wouter99999’s picture

Dear Mizydearia, thanks for your help! Acually that line does not exist in my (patched with cck_phone-d7_r3.patch) D7 version of the module. But your fix got me a clou, and I could fix it now (line 750) :

from: '#default_value' => isset($settings['default_country']) ? $settings['default_country'] : NULL,

to: '#default_value' => isset($element['#value']['country_codes']) ? $element['#value']['country_codes'] : (isset($settings['default_country']) ? $settings['default_country'] : NULL),

ckng’s picture

Status: Active » Closed (fixed)

For D6, this is fixed in the dev.
D7 is fixed just not yet re-roll the patch.