Created
October 21, 2012 01:45
-
-
Save bangpound/3925424 to your computer and use it in GitHub Desktop.
support jplayer embedded in filtered text fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/jplayer.theme.inc b/includes/jplayer.theme.inc | |
index 410d605..3e63c96 100644 | |
--- a/includes/jplayer.theme.inc | |
+++ b/includes/jplayer.theme.inc | |
@@ -15,8 +15,12 @@ function template_preprocess_jplayer(&$vars) { | |
$vars['mode'] = $vars['settings']['mode']; | |
// Get the field info so we can figure out what type it is. | |
- $field_info = field_info_field($vars['field_name']); | |
- $player = jplayer_sort_files($vars['items'], $vars['player_id'], $vars['mode'], $field_info['type']); | |
+ if ($field_info = field_info_field($vars['field_name'])) { | |
+ $player = jplayer_sort_files($vars['items'], $vars['player_id'], $vars['mode'], $field_info['type']); | |
+ } | |
+ else { | |
+ $player = jplayer_sort_files($vars['items'], $vars['player_id'], $vars['mode']); | |
+ } | |
$vars['playlist'] = theme('jplayer_item_list', array('items' => $player['playlist'])); | |
$vars['type'] = $player['type']; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment