sverhagen / mp3-browser

This Joomla plugin will create a table of every MP3 in a specified folder. It displays the ID3 information of each track with a link to download or play the file in the browser
https://www.totaalsoftware.com/products/mp3-browser
GNU General Public License v2.0
5 stars 6 forks source link

Components again not working #62

Closed sverhagen closed 9 years ago

sverhagen commented 9 years ago

The change in 24227a1efe9e3d241e3cfb02af086d8889be5baa makes the plugin not work for components anymore, due to $article->introtext always empty, thus the entire thing ignored in MusicTagsHelper.

The problem is the following check in MusicTagsHelper.php:

if (isset($article->introtext))

It appears that introtext does not exist in component texts.

I think the correct version should be:

public static function getMusicTagsFromArticle($article) {
  $matches1 = array();
  $matches2 = array();
  if (isset($article->introtext)) {
    $matches1 = self::getMusicTagsFromText($article->introtext);
  }
  if (isset($article->text)) {
    $matches2 = self::getMusicTagsFromText($article->text);
  }
  return array_unique(array_merge($matches1, $matches2));
}