When I try to display a video, I get the following error message:
Notice: Undefined variable: value in brightcove_field_get_value() (line 1649 of /Users/thomas/Sites/gilt/cms_about/docroot/sites/all/modules/contrib/brightcove/brightcove_field/brightcove_field.module).
Notice: Trying to get property of non-object in theme_brightcove_field_embed() (line 114 of /Users/thomas/Sites/gilt/cms_about/docroot/sites/all/modules/contrib/brightcove/brightcove_field/theme.inc).
Notice: Trying to get property of non-object in theme_brightcove_field_embed() (line 118 of /Users/thomas/Sites/gilt/cms_about/docroot/sites/all/modules/contrib/brightcove/brightcove_field/theme.inc).
Digging into the code, I can see that the brightcove_field_get_value() function looks pretty half-baked. In fact, I can't even gather what the function was supposed to accomplish:
function brightcove_field_get_value($instance, $stored) {
if ($stored) {
return $stored;
}
if (!empty($instance['settings'][$value])) {
$instance['settings'][$value];
}
return NULL;
}
Without this function, players won't load and therefore render. Any idea what this function was originally supposed to do?
Comments
Comment #1
chromix commentedWhen I change the brightcove_field_get_value() function like this, everything magically works:
Hopefully someone can commit a fix to this soon?
Comment #2
tamasd commentedFixed in bc9776c67057697bd9886f3eabcbaf1482b74b2a. Thanks for the solution. This function was refactored recently, and I incidentally forget to properly rewrite it. A new release will be out in a few minutes.
Comment #3
decipheredI checked out the latest version from GIT and this issues still appears to exist.
Comment #4
tamasd commentedThis works me with the 7.x-3.1 version. Can you verify?
Comment #5
chromix commentedThis worked for me as well when I checked out the code, although I'm not using the 3 branch actively.
Comment #6
murrayw commentedI think that line 1650 in brightcove_field.module is missing a 'return' statement.
Comment #7
tamasd commentedThanks for noticing. The fix has been pushed to the 7.x-3.x branch.
Comment #8
tamasd commentedComment #9.0
(not verified) commentedfixing code formatting