Joomla Podcasting Component Bug and Fix

I’m using the Joomla Podcasting Component by Joseph LeBlanc to generate my podcasts on this site. Today was the first real podcast I put up…I noticed that my podcatcher wasn’t downloading the mp3 file so I went looking. It turns out that my enclosure URLs were being generated incorrectly.

I normally enter the fully qualified URL instead of the path (long story). Everything was playing correctly; however, the podcast XML wasn’t being generated correctly. It had my <site URL> + <path> + <enclosure tag url> included. So, if I had entered something like “http://media.maxsons.org/MaxsonPodcast/2008/20080919_MaxsonMissionMissivePodcast.mp3” into my enclosure tag, the enclosure URL was getting generated like “http://www.maxsons.org/media_files/http://media.maxsons.org/MaxsonPodcast/2008/20080919_MaxsonMissionMissivePodcast.mp3” See the problem?

Well, the error was in the podcast.php file (line 345 to be exact). that line says

$paramarray[0] = $mosConfig_live_site . “/” . $params->def( ‘mediapath’, ‘images/stories’ ) . “/” . $paramarray[0];

Well, you only want to do that IF you haven’t included the full URL in the enclosure tag already. So, if you want to make the fix, just change that line to these two lines:

if(!strstr($paramarray[0], ‘http://’))

$paramarray[0] = $mosConfig_live_site . “/” . $params->def( ‘mediapath’, ‘images/stories’ ) . “/” . $paramarray[0];

Or, just download this zip file and overwrite your existing podcast.php file (it is in <your site’s install directory>/<components>/<com_podcast> directory).

Now, you’ll be good to go. This code is distributed under the GPL (choose your version).

Leave a Reply

Your email address will not be published. Required fields are marked *