Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.