I am using hook_preprocess_image() to add classes to the image attributes array. A PHP Fatal error occurs on print pages when attempting to add a class to the 'class' array since 'class' is a string in print.pages.inc:

<?php
  $print['logo'] = $logo_url ? theme('image', array('path' => $logo_url, 'alt' => $site_name, 'attributes' => array('class' => 'print-logo', 'id' => 'logo'))) : '';
  // Above should be:
  // $print['logo'] = $logo_url ? theme('image', array('path' => $logo_url, 'alt' => $site_name, 'attributes' => array('class' => array('print-logo'), 'id' => 'logo'))) : '';
?>
CommentFileSizeAuthor
#3 theme_image_class-2696653-3.patch837 bytesadamzimmermann
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blasthaus created an issue. See original summary.

blasthaus’s picture

Issue summary: View changes
adamzimmermann’s picture

Status: Active » Needs review
FileSize
837 bytes

Simple patch attached.

markdorison’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Reviewed & tested by the community
adamzimmermann’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Just found the original issue that also reported this. Marking this as duplicate.

https://www.drupal.org/node/2268657

markdorison’s picture