In template_preprocess_media_brightcove_video the publisher_id and player_id are searched for in several different places, the last of which is the settings found on admin/content/emfield/emvideo. Since the check's are done using isset() on the field widget settings, it never falls through to the global settings. I spent quite some time trying to figure out why my videos kept showing up as unavailable because I had the settings in place on the global settings, but not at the field level.

I'd suggest using !empty() rather than isset().

CommentFileSizeAuthor
#1 media_brightcove_theme.patch3.48 KBkbasarab

Comments

kbasarab’s picture

Version: 6.x-1.1-beta4 » 6.x-1.1-beta5
StatusFileSize
new3.48 KB

This still existed on beta5. This patch should fix it.

--- themes/media_brightcove.theme.inc	2011-02-04 09:53:50.000000000 -0500
+++ themes/media_brightcove.themeNEW.inc	2011-02-04 09:53:47.000000000 -0500
@@ -31,21 +31,21 @@ function template_preprocess_media_brigh
   static $count = 0;
 
   if ($variables['video_id']) {
-    $variables['width'] = isset($variables['width']) ? $variables['width'] : (isset($variables['options']['width']) ? $variables['options']['width'] : media_brightcove_variable_get('default_width'));
-    $variables['height'] = isset($variables['height']) ? $variables['height'] : (isset($variables['options']['height']) ? $variables['options']['height'] : media_brightcove_variable_get('default_height'));
+    $variables['width'] = !empty($variables['width']) ? $variables['width'] : (!empty($variables['options']['width']) ? $variables['options']['width'] : media_brightcove_variable_get('default_width'));
+    $variables['height'] = !empty($variables['height']) ? $variables['height'] : (!empty($variables['options']['height']) ? $variables['options']['height'] : media_brightcove_variable_get('default_height'));
 
-    $variables['full_size'] = isset($variables['options']['full_size']) ? $variables['options']['full_size'] : media_brightcove_variable_get('full_size_default');
+    $variables['full_size'] = !empty($variables['options']['full_size']) ? $variables['options']['full_size'] : media_brightcove_variable_get('full_size_default');
 
-    $publisher_id = $variables['publisher_id'] ? $variables['publisher_id'] : (isset($variables['options']['field']['widget'][media_brightcove_variable_name('publisher_id')]) ? $variables['options']['field']['widget'][media_brightcove_variable_name('publisher_id')] : media_brightcove_variable_get('publisher_id'));
+    $publisher_id = $variables['publisher_id'] ? $variables['publisher_id'] : (!empty($variables['options']['field']['widget'][media_brightcove_variable_name('publisher_id')]) ? $variables['options']['field']['widget'][media_brightcove_variable_name('publisher_id')] : media_brightcove_variable_get('publisher_id'));
     $variables['publisher_id'] = check_plain($publisher_id);
 
     // Work out which player ID to use:
     $player_id = $variables['player_id'] ? $variables['player_id'] : NULL;
     if ($variables['full_size']) {
-      $player_id = isset($player_id) ? $player_id : (isset($variables['options']['field']['widget'][media_brightcove_variable_name('full_player_id')]) ? $variables['options']['field']['widget'][media_brightcove_variable_name('full_player_id')] : media_brightcove_variable_get('full_player_id'));
+      $player_id = !empty($player_id) ? $player_id : (!empty($variables['options']['field']['widget'][media_brightcove_variable_name('full_player_id')]) ? $variables['options']['field']['widget'][media_brightcove_variable_name('full_player_id')] : media_brightcove_variable_get('full_player_id'));
     }
     else {
-      $player_id = isset($player_id) ? $player_id : (isset($variables['options']['field']['widget'][media_brightcove_variable_name('preview_player_id')]) ? $variables['options']['field']['widget'][media_brightcove_variable_name('preview_player_id')] : media_brightcove_variable_get('preview_player_id'));
+      $player_id = !empty($player_id) ? $player_id : (!empty($variables['options']['field']['widget'][media_brightcove_variable_name('preview_player_id')]) ? $variables['options']['field']['widget'][media_brightcove_variable_name('preview_player_id')] : media_brightcove_variable_get('preview_player_id'));
     }
 
     $variables['player_id'] = check_plain($player_id);
marcp’s picture

The 6.x-2.x version of this is incorporated in #1071226: Echove PHP library no longer exists if anyone here is interested in testing out the new Brightcove API.

frankcarey’s picture

Version: 6.x-1.1-beta5 » 6.x-2.x-dev
Assigned: Unassigned » frankcarey

Merged #1 to 2.x branch
Commit: 4422bb5ece5cec1b6ec723f4917756a092206f4a

If this is still needed in the 1.x branch please reopen.

frankcarey’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.