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.
See #1382470: Content is right aligned for background information.
This theme applies special theming logic to any content type that contains a field named "field_image" regardless of the field type and regardless of whether or not the field is empty. The template.php file should be modified such that the logic is applied only if the field is populated, and only if the field is an "image" field.
Existing code in touchpro_preprocess_node():
if (isset($vars['field_image'])) {
$vars['classes_array'][] = 'node-imagefield';
}
Recommended change:
if (!empty($vars['field_image']) &&
$vars['elements']['field_image']['#field_type'] == 'image') {
$vars['classes_array'][] = 'node-imagefield';
}
Comments
Comment #1
JurriaanRoelofs CreditAttribution: JurriaanRoelofs commentedfix
Comment #2.0
(not verified) CreditAttribution: commentedCorrected format of reference to related issue.