Notice: Undefined index: #item in us_formatter_local() (line 123 of ...sites/all/modules/cck_phone/includes/phone.us.inc).

Just updated to the new dev version and now whenever I try to access a node with a phone number I get the error message in the header. I do not have country level validation enabled and I do have phone extension support enabled. I tried resaving the field preferences, clearing the cache, running the update again and the problem persists. I also opened up a node with a phone number and resaved it – and the error message still appears on the node in question.

Is anyone else experiencing this issue?

CommentFileSizeAuthor
#3 cck_phone-us_formatter-1327550-3.patch1.49 KBckng

Comments

geerlingguy’s picture

Also having this issue.

thinkyhead’s picture

This causes US phone numbers to appear blank - in my case it shows up on the user page blank, but the extension is there. The problem is the way the field formatter function is being called from theme_cck_phone_formatter_global_phone_number() and theme_cck_phone_formatter_local_phone_number() in the cck_phone.module file.

The quickest fix I found was to replace occurrences of:

      if (function_exists($function)) {
        $phone = $function($element);
      }

...with...

      if (function_exists($function)) {
        $phone = $function(array('#item'=>$element));
      }

Too lazy to roll a patch, and I'm not sure if this is the right approach. (Also, if you feel like fixing another minor typo, the first function should only return $phone and not $phone . $ext.)

ckng’s picture

Status: Active » Fixed
StatusFileSize
new1.49 KB

Patch committed to dev.

geerlingguy’s picture

Thanks! Was just noticing this error in the logs this morning.

Status: Fixed » Closed (fixed)

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