theme_picture's hook_theme declaration states that it has "attributes" variable:
'picture' => array(
'variables' => array(
'style_name' => NULL,
'path' => NULL,
'uri' => NULL,
'width' => NULL,
'height' => NULL,
'alt' => '',
'title' => NULL,
'attributes' => array(),
'breakpoints' => array(),
),
),
However theme_picture_formatter doesn't pass any attributes set on the item to theme_picture:
$responsive_image = array(
'#theme' => 'picture',
'#width' => isset($item['width']) ? $item['width'] : NULL,
'#height' => isset($item['height']) ? $item['height'] : NULL,
'#style_name' => $variables['image_style'],
'#breakpoints' => $variables['breakpoints'],
'#uri' => $item['uri'],
'#alt' => isset($item['alt']) ? $item['alt'] : '',
);
I propose to change the above to:
$responsive_image = array(
'#theme' => 'picture',
'#width' => isset($item['width']) ? $item['width'] : NULL,
'#height' => isset($item['height']) ? $item['height'] : NULL,
'#style_name' => $variables['image_style'],
'#breakpoints' => $variables['breakpoints'],
'#uri' => $item['uri'],
'#alt' => isset($item['alt']) ? $item['alt'] : '',
'#attributes' => isset($item['attributes']) ? $item['attributes'] : NULL,
);
Comments
Comment #1
baysaa commentedPatch added.
Comment #2
attiks commentedThnaks