Download & Extend

Image path wrong in xsfp_playlist_node.module

Project:XSPF Playlist
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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.

Comments

#1

Please post which code to change in the 6.x version please.

#2

Version:5.x-1.20-beta1» 6.x-1.x-dev

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.

#3

Priority:critical» normal

that should really be

$thumbs[] = url($file->filepath);

i'm not able to test atm though. but here's a patch if anyone wants:

AttachmentSize
fix-image-patch.372622.3.patch 863 bytes

#4

Is this issue still not fixed? Is the maintainer MIA?

nobody click here