I'm posting as documentation and have already set the status to fixed.
I upgraded to Ubuntu 12.10 which include PHP 5.4. My fix was to downgrade back to PHP 5.3.

cck_phone I'm using is 7.x-1.x-dev - 2012-Mar-02. My drupal installation is 7.16.

After upgrading to PHP 5.4 I started getting the WSOD. /var/log/apache2/error.log had the following error:
PHP Fatal error: Unsupported operand types in $drupalroot/includes/theme.inc on line 1074, referer: http://cows/views/people/employees

I tracked it down to the following lines in cck_phone.module: line 287 and 318.

// Extension
if (!empty($element['extension'])) {
  $phone = $phone . theme('phone_number_extension', $element['extension']);
}

Variable $element['extension'] is a simple string. The theme.inc theme() function expects an array. $element['extension'] becomes '$variables' in the theme function. The error occurs on line 1074 when the $variables array is appended to.

// Merge in argument defaults.
  if (!empty($info['variables'])) {
    $variables += $info['variables'];
  }
  elseif (!empty($info['render element'])) {
    $variables += array($info['render element'] => array());   // line 1074
  }

I'm just learning PHP and don't know what the real fix is, but I'll stick to PHP 5.3 in the meantime

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TuFrac’s picture

Assigned: Unassigned » TuFrac
Status: Closed (fixed) » Needs review
FileSize
874 bytes

I had the same problem, I have done this patch, I hope you work

jbehshad’s picture

I had the same issue. Patch on #1 works for me. Thank you TuFrac.

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

This is good!

If the current maintainer is not up for committing working patches, let this be the formal request that a co-maintainer be added. I'm willing but i'm sure there are much better candidates.

valthebald’s picture

Status: Reviewed & tested by the community » Needs work

Patch does the job, yet is not quite well formatted. If the author can fix empty lines of changed lines, that would be good

valthebald’s picture

Status: Needs work » Needs review
FileSize
1.13 KB

Here's my take. I also dared to place better default value for theme_phone_number_extension()

RoSk0’s picture

More Drupal style fix with minor code style fixes.

valthebald’s picture

Status: Needs review » Needs work

I second 'render element' => 'variables' replacement in #6
2 tiny things. If we're correcting comments, let's fix some grammar:

  1. Call country default formatter if exists.
  2. Output a raw value if no custom formatter or formatter returns empty value.
RoSk0’s picture

Status: Needs work » Needs review
FileSize
3.34 KB
1.01 KB

New version.

valthebald’s picture

Status: Needs review » Needs work

Tiny-tiny thing left:
// Call country default formatter if exist
appears twice in code

RoSk0’s picture

Assigned: TuFrac » RoSk0
Status: Needs work » Needs review
FileSize
947 bytes
3.29 KB

One more try...

valthebald’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me

valthebald’s picture

Issue summary: View changes

Adding the current drupal installation revision

ckng’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Thanks for all the works, committed to D7.

Status: Fixed » Closed (fixed)

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