Image path wrong in xsfp_playlist_node.module
crystaldawn - February 11, 2009 - 10:04
| Project: | XSPF Playlist |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
When putting thumbs into a playlist, the path is created incorrectly. It uses a relative path and does not append the base_path() to the path it receives. This will cause images to not show up on anything that is not in the document root. The fix is simple.
On line 370 change:
<?php
'value' => $thumb,
?>To
<?php
'value' => base_path().$thumb,
?>Now when you view /node/1/xspf from a player that is located at something like /node/somewhere, the images will actually show up rather than be blank.

#1
Please post which code to change in the 6.x version please.
#2
I have found the solution for this in 6.x.
In xspf_playlist\xspf_playlist_thumb\xspf_playlist_thumb.module go to line 162.
Change it from
if (strstr($file->filemime, 'image')) {$thumbs[] = $file->filepath;
}
to
if (strstr($file->filemime, 'image')) {$thumbs[] = '/'. $file->filepath;
}
In my scenario, merely adding the slash was enough to make the images no longer break.