When I select only one country for a phone field and leave the 'Hide when only one country code' option unchecked, I get the following errors:
Notice: Undefined variable: countrycode in cck_phone_phone_number_validate() (line 816 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode in cck_phone_phone_number_validate() (line 840 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode in cck_phone_phone_number_validate() (line 852 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode in _cck_phone_validate() (line 400 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode in _cck_phone_validate() (line 424 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode in _cck_phone_validate() (line 436 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
Notice: Undefined index: country_codes in _cck_phone_sanitize() (line 487 of /var/www/d7/sites/all/modules/dev/cck_phone/cck_phone.module).
The $phone_input variable is also not initialized in cck_phone_phone_number_validate() so it may also cause issues.
Comments
Comment #1
hermanns commentedGet the same error.
Comment #2
rojesaga commentedSame here,
I Use the 7.x-1x-dev 2011-Dec-18
Default country code: - Mexico
Not Show all Country codes
Unselected the "Enable contry level validation" (Also try with it)
ERROR - Used as field on Profile 2
Notice: Undefined variable: countrycode en cck_phone_phone_number_validate() (línea 816 de /home/ggarciat/public_html/ideageek.mx/demo/cmh/sites/all/modules/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode en cck_phone_phone_number_validate() (línea 834 de /home/ggarciat/public_html/ideageek.mx/demo/cmh/sites/all/modules/cck_phone/cck_phone.module).
Invalid country code "" submitted.
Notice: Undefined variable: countrycode en cck_phone_phone_number_validate() (línea 840 de /home/ggarciat/public_html/ideageek.mx/demo/cmh/sites/all/modules/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode en _cck_phone_validate() (línea 400 de /home/ggarciat/public_html/ideageek.mx/demo/cmh/sites/all/modules/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode en _cck_phone_validate() (línea 418 de /home/ggarciat/public_html/ideageek.mx/demo/cmh/sites/all/modules/cck_phone/cck_phone.module).
Notice: Undefined variable: countrycode en _cck_phone_validate() (línea 424 de /home/ggarciat/public_html/ideageek.mx/demo/cmh/sites/all/modules/cck_phone/cck_phone.module).
Comment #3
dddbbb commentedSame problem for me. Have left all country codes available as a temporary fix.
Comment #4
tommychrisA little piece of modification, not the best, but in my case, it works, I hope it helps:
cck_phone.module line 764
Comment #5
ckngMistaken:
This has been fixed per #1323726: Make default country code optionalBut it has been fixed in the dev.