Active
Project:
Embedded Media Field
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2011 at 05:50 UTC
Updated:
10 May 2012 at 17:30 UTC
Both 6.x-2.5 and the dev version fail to embed media in a textarea using the format specified by the input filter tips.
In contrib/eminline/eminline.module in the function _eminline_url_parse_full_links the array that is used for providers doesn't match that expected by the code that matches on providers:
// Build a fake field, remember that emfield is well a field.
$field = array(
'field_name' => 'eminline',
'type' => 'emvideo',
'video_width' => $video_default['video_width'],
'video_height' => $video_default['video_height'],
'video_autoplay' => $video_default['video_autoplay'],
'preview_width' => $preview_default['preview_width'],
'preview_height' => $preview_default['preview_height'],
'preview_autoplay' => $preview_default['preview_autoplay'],
'thumbnail_width' => $tn_default['thumbnail_width'],
'thumbnail_height' => $tn_default['thumbnail_height'],
'thumbnail_default_path' => $tn_default['thumbnail_default_path'],
'providers' => variable_get('eminline_providers_' . $format, array_keys(emfield_system_list('emvideo', NULL, FALSE))),
);
// Build our embed item.
$item = emfield_parse_embed($field, $match[1], 'emvideo');
// Check to make sure the provider that was found is an allowed provider.
if ($field['providers'][$item['provider']]) {
$item['data'] = (array)emfield_include_invoke('emvideo', $item['provider'], 'data', $field, $item);
}
else {
return $match[0];
}
Note that the $field['providers'] array is not indexed by the provider name, and contains just the names of providers. The if statement in the last code block should be:
// Check to make sure the provider that was found is an allowed provider.
if (in_array($item['provider'], $field['providers'])) {
Comments
Comment #1
webservant316 commentedsubscribe - also having trouble getting inline embedding to work
Comment #2
webservant316 commentedalso I tried both 6.x-2.5 and 6.x-2.x-dev with the same result. Could not get inline embedding to work.
Comment #2.0
webservant316 commentedFixed typo in code block