When brightcove_field_player is called it passes the $entity->language to grab the field value, but I think this is a logic error. That is because even if the node is translated the field is by default not translated. So this should be checking something else to see if field is translated.
What's happening is it's passing 'en' to the field and coming up with no value bc the value is stored in 'un' which is usually the case as I think field translation is less common.
Here is the code:
$video_id = $entity->{$field_name}[isset($entity->language) ?
$entity->language : 'und'][$delta]['video_id'];
$player_name = $entity->{$field_name}[isset($entity->language) ?
$entity->language : 'und'][$delta]['player_id'];
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | field_translation-1851002-1.patch | 1.09 KB | valderama |
Comments
Comment #1
valderama commentedRun into the same issue today. A problem occurs if the node as assigned a language (lets say 'en') but the field itself is not translatable (uses 'und').
The solution is quite simple, just use field_language to determine the language of the field.
There is another issue within the same two lines; the index of the player is not 'player_id' but 'player'. I have checked other code in the module, and it seems that at all other places the correct value is used. I'll include a patch with both fixes.
Comment #2
hairqles commentedCommitted and pushed to the 7.x-3.x branch the fix will be included in the next release.
Thank you!