Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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'))) : '';
?>
Comment | File | Size | Author |
---|---|---|---|
#3 | theme_image_class-2696653-3.patch | 837 bytes | adamzimmermann |
Comments
Comment #2
blasthaus CreditAttribution: blasthaus commentedComment #3
adamzimmermann CreditAttribution: adamzimmermann at Chromatic for Meredith Corporation commentedSimple patch attached.
Comment #4
markdorisonComment #5
adamzimmermann CreditAttribution: adamzimmermann commentedJust found the original issue that also reported this. Marking this as duplicate.
https://www.drupal.org/node/2268657
Comment #6
markdorison