In Drupal 4.6 the $attributes argument is a string. The 4.6 version of the CivicSpace theme incorrectly treats this the HEAD way- as an array. This needs to be fixed along with any places the theme itself calls theme_image().

Comments

factoryjoe’s picture

Assigned: Unassigned » factoryjoe

This should do it (patch coming soon):

<code>
function phptemplate_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
  switch ($path) {
  case 'misc/arrow-asc.png':
    $path = path_to_theme() . '/images/asc.png';
    break;
  case 'misc/arrow-desc.png':
    $path = path_to_theme() . '/images/desc.png';
    break;
  }
  if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
    $attributes = drupal_attributes($attributes);
    return '<img src="'. check_url($path) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
  }
} 

drumm’s picture

$attributes = drupal_attributes($attributes);

I think that will still cause this error.

factoryjoe’s picture

StatusFileSize
new1.53 KB

Drumm, I copied this function from the original function in Drupal 4.6.1... Why won't it work?

drumm’s picture

4.6 version according to drupaldocs:

function theme_image($path, $alt = '', $title = '', $attr = '', $getsize = true) {
  if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
    return '<img src="'. check_url($path) .'" '. $attr .' alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" />';
  }
}

Notice that the 4th argument, $attr, is treated as a string, and not passed to drupal_attributes().

factoryjoe’s picture

StatusFileSize
new1.47 KB

Fixed. Thanks.

factoryjoe’s picture

StatusFileSize
new1.47 KB

One more time, for old time's sake.

drumm’s picture

Looks good on visual inspection. Watch your indentation.

bomarmonk’s picture

I'm getting a malformed patch message in line 4 when I try to apply this patch... maybe I'm messing-up the patch when I download? Not sure.

drumm’s picture

I went ahead and committed a modified version myself.

Anonymous’s picture

drumm’s picture

Version: » 4.6.x-1.x-dev
Status: Fixed » Closed (fixed)