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.
When you select in a view or in display settings the image_link formatter, doesn't work, because the default option is none instead empty. Fixed:
Before
if (empty($elements['#brightcove_image_link'])) {
return $image;
}
After
if (($elements['#brightcove_image_link'] == 'none') || (empty($elements['#brightcove_image_link']))) {
return $image;
}
When you select original image in the style select, doesn'work. Fixed:
Before
if (empty($elements["#{$type}"]->{$elements['#brightcove_image_type']})) {
$path = brightcove_get_default_image();
$styled_path = image_style_path($elements['#brightcove_image_style'], 'default-image.png');
$style = image_style_load($elements['#brightcove_image_style']);
image_style_create_derivative($style, $path, $styled_path);
$image = theme('image', array('path' => $styled_path));
}
else {
$remote_file = brightcove_remote_image($elements["#{$type}"]->{$elements['#brightcove_image_type']});
$image = theme('image_style', array(
'style_name' => $elements['#brightcove_image_style'],
'path' => $remote_file,
));
}
After
if (empty($elements["#{$type}"]->{$elements['#brightcove_image_type']})) {
$path = brightcove_get_default_image();
$styled_path = image_style_path($elements['#brightcove_image_style'], 'default-image.png');
$style = image_style_load($elements['#brightcove_image_style']);
image_style_create_derivative($style, $path, $styled_path);
$image = theme('image', array('path' => $styled_path));
}
else {
$remote_file = brightcove_remote_image($elements["#{$type}"]->{$elements['#brightcove_image_type']});
if ($elements['#brightcove_image_style']){
$image = theme('image_style', array(
'style_name' => $elements['#brightcove_image_style'],
'path' => $remote_file,
));
}else{
$image = theme('image', array('path' => $remote_file));
}
}
This is the patch:
Comment | File | Size | Author |
---|---|---|---|
#1 | brightcove-fix-formatter-2266341.patch | 1.08 KB | jansete |
Comments
Comment #1
jansete CreditAttribution: jansete commentedComment #2
jansete CreditAttribution: jansete commentedAn other problem in the formatter when you choose link to entity or dialog, never store the new value. But now is fixed.
brightcove_field.module
The previous code:
The fixed code:
The patch include the new changes and yesterday changes
Comment #4
k.dani CreditAttribution: k.dani commentedThe first part of the issue is fixed with the first patch. The second part of the issue has been already fixed (Commit 413f621 on 7.x-5.x), so I hide the second patch, because it is not good.
Next time, please create separated issues for different problems to be able to follow them easily. Anyway, thanks for your help.
Comment #5
k.dani CreditAttribution: k.dani commented