Active
Project:
Media: YouTube
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2012 at 17:20 UTC
Updated:
19 Jan 2012 at 17:20 UTC
if (!$flv_path) {
$form['player']['jwflv']['#description'] = t('You must first install the !flvplayer, preferably in your /sites/all/plugins folder.', array('!flvplayer' => l(t('JW FLV Media Player'), 'http://www.longtailvideo.com/players/jw-flv-player/')));
}
if ($flv_path && !_media_youtube_check_flv_player_setup()) {
$form['player']['jwflv']['#description'] = t('You must have the yt.swf file installed in the same folder as your !flvplayer.', array('!flvplayer' => l(t('JW FLV Media Player'), 'http://www.longtailvideo.com/players/jw-flv-player/')));
}
$form['player']['jwflv']['#description'] = $form['jwflv']['#description'] ? $form['jwflv']['#description'] : t('!flvplayer is properly configured on your server, so may be used to play YouTube videos if desired.', array('!flvplayer' => l(t('JW FLV Media Player'), 'http://www.longtailvideo.com/players/jw-flv-player/', array('attributes' => array('target' => '_blank')))));
The text set in either of the if statements gets clobbered afterwards and hence never shows.
Should $form['jwflv']['#description'] ? be $form['player']['jwflv']['#description'] ? instead?
To guard against such bugs and for better readability, it's probably better to set the default description first and then override it for special cases.