Media path being set to sites/default/files/sites/default/files

docillenstein - March 13, 2009 - 18:07
Project:SWF Tools
Version:6.x-2.5
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

After upgrading to 6-2.3 from 6-1.3, the player for single mp3s is rendering as Flowplayer3, and doing so with the wrong path. It's trying to read from sites/default/files/sites/default/files - a duplicate path which doesn't exist. It seems to be assuming that the mp3 in a post is mixed media rather than just an mp3.

I see

You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialise correctly.

if I set the player for Mixed Media to JW4 and

200, Stream not found, NetStream.Play.streamNotFound, clip '[Clip] 'sites/default/files/sites/ default/files

when its set to Flowplayer3.

I'm only calling for one mp3 file in the swf syntax, doing it through TinyMCE in the WYSIWYG API.

AttachmentSize
Picture 8.png18.12 KB

#1

Stuart Greenfield - March 13, 2009 - 19:29

That sounds very strange. The message you are seeing for FlowPlayer3 is the one you should see if you're trying to stream audio, rather than play a file. Can you confirm how you're calling SWF Tools.

If I use <swf file="audio.mp3"> locally then it works fine, and I can use any player that I like. Was it all working ok before the upgrade?

Does it start working normally if you downgrade back to 6.x-1.3?

The other thing you can try is check the SWF Tools status page - what does that say is configured as the default player?

#2

Stuart Greenfield - March 31, 2009 - 19:03
Title:Wrong player, wrong path to files» Media path being set to sites/default/files/sites/default/files

I'm renaming this thread as I have now seen this report in a few places.

For some reason, for some users, the file path to an audio file is being presented as sites/default/files/sites/default/files.

I have never seen this behavior locally, but it is clearly something that is not affecting everyone, but is relatively common. Therefore I am going to use this thread to try and track down why it is happening.

Based on the post above, for this user, things were ok at version 6.x-1.3, but broken in 6.x-2.3. That at least might pin down what code was changed and shed some light on the change.

Please can anyone else being affected by this bug report in this thread so I can try to establish a picture of what is causing the bug to appear.

Thanks.

#3

Stuart Greenfield - March 31, 2009 - 19:06

A similar issue is reported in #418064: External Files in filter not working where the wrong path is being created when using an external reference.

#4

Stuart Greenfield - March 31, 2009 - 22:39
Status:active» needs review

OK, I think I may have an idea of what is happening.

When I was tidying up the issue queue tonight I found #351725: SWF Tools <swf></swf> tags being removed by Tiny MCE on page 2, somewhat lost, that describes an issue with the WYSIWYG editors.

First I tried installing WYSIWYG API and TinyMCE and it was working ok, although you have to use the [swf] filter format rather than <swf> (but that's ok, the [swf] filter is now working properly. As an aside [] is the preferred Drupal way to write a filter, so I'm going to start promoting that syntax from now)

As a test I tried locally using the swf filter, not in a WYSIWYG editor, but setting <swf file="">, ie passing an empty file. That resulted in the message No player is configured to play a series mixed media files. Check the SWF Tools file handling settings on the configuration page..

If I then do what you have done and configure a media player for mixed media then it tries to render the empty file and I get the player trying to play http://localhost/drupal6/sites/default/files/sites/default/files, exactly the error that is being reported.

So, what does this mean. I think the issue might be related to users that are using WYSIWYG editors that change the input and result in a filter string that SWF Tools no longer recognises. It must be recognising the swf part since it is trying to render something, but it I suspect it is not properly detecting file="somefile". So SWF Tools tries to render an empty file. In turn, SWF Tools doesn't know what to do with a "nothing" so it interprets it as mixed media (so I need to fix it to intercept an empty file to make it clear what is wrong, but park that for now).

The linked thread also suggests that " can be encoded to &quot; and if that is happening then that will break the filter. A patch is provided to fix it.

I simulated this scenario by creating an input filter using &quot; instead of ", and again, I get the error message as the filter doesn't find the file. Using the suggested patch makes it work properly.

I then ran a test using FCKeditor, and without the patch the filter fails. With the new patch it works fine.

So I am now fairly sure that the issue here is the WYSIWYG editors cleaning the code in a way that the SWF Tools processor didn't like.

As this looks like the probable fix I have committed it on branches DRUPAL-5 and DRUPAL-6--2. If people experiencing this issue could pick up the latest code and give it a go I'm very hopeful this will fix your issue.

I have also changed the wording in the help and filter tips to show the filter in the new, preferred [swf] format and I will get round to amending the documentation to encourage use of this format.

The only thing I don't understand is that the filter processor didn't change between 6.x-1.3 and 6.x-2.3!

Please can you post your findings - to me this patch looks good locally so I plan to make a new release very soon, but would appreciate any feedback on whether it works for other users.

#5

Stuart Greenfield - April 27, 2009 - 11:00
Status:needs review» fixed

Released in SWF Tools 6.x-2.5.

#6

escoles - May 5, 2009 - 19:10
Version:6.x-2.3» 6.x-2.5
Status:fixed» active

Re-opening and adjusting version as I am seeing this in 6.x-2.5, with video. Some of my particulars are different, but it seems to me likely to be related.

If I view the rendered source, I see the following as the path to the video directory:

/sites/default/files/sites/default/files

Differences:

  1. Using FCKEditor, not TinyMCE+WYSIWYG API. (I have verified that the error persists if I edit and save the node after disabling FCKEditor on that node.)
  2. JW4 player loads and returns error 2032.

Similarities:

  1. File is being read as mixed media (guess that's a function of the broken path?)
  2. Path broken in the same way.

ADDENDUM:

  • FWIW, I've verified that this is also happening with external paths. That is, I get the same repetition of the path to the video files directory.
  • I've also verified that the original external path is good by using it to load the test video in a standalone client.

#7

VM - May 17, 2009 - 18:07

#8

escoles - May 17, 2009 - 18:18

Note that this issue has been observed on systems which have never had a WYSIWYG editor enabled.

See first comment at:
http://drupal.org/node/449892

#9

clemens.tolboom - May 18, 2009 - 10:06

fwiw I cannot render my own player from the themes directory

<?php
swf
('sites/all/themes/my_theme/player.swf')
?>

What I noted in swftools.module is that in line 443 I would expect a negation. That is if _no_ media path given make it into drupals files system directory

<?php
     
// Then check if files are being sourced locally, and if they are build a file path
     
if (__ ! __ swftools_get_media_path()) {
       
$file = file_create_path($file);
      }
?>

(Changing the media path would off course render my swf files uploaded into drupal filesystem useless.)

In code there are a few calls to file_create_path and file_create_url ... could it be that somewhere a '/' got into the $file which bumps it into the file system.
That could explain the duplication of the file system path.

Hope this helps :)

#10

jmpalomar - June 23, 2009 - 21:08

I got the same problem and resolved rearranging the filter order.
In my case seems some kind of interference between SWFTools and Typogrify. When I putted Typogrify after SWFTools all worked ;).

Hope this helps

#11

utter-joy - August 11, 2009 - 16:50

I seem to be getting this when trying to refer to a manually made (or generated by swf tools) playlist, manually ftp transfered to the playlists directory which refers to files manually ftp transfered to default/files/(directory_name), using the [swf file="playlists/playlist.xml"] command typed in the body of the content. Being a newby, I don't know if this is exactly related, but I see the error in recent log report. Even though error reporting is set to both screen and log file, I don't see the error on the page, just get no audio, although the player seems to show up.

Also, when using [swf files="file1.mp3&&file2.mp3&&file3.mp3"] I do get an error on the page which states "cannot display the player because the file amp; does not appear to exist."

Using swf tools 6.5, jwmediaplayer4, and drupal 6.2

#12

sdmaxey - December 11, 2009 - 09:40

I'm getting this error--with all other input filters turned off with an input profile that does not include a WYSIWYG editor. Has there been any progress on finding the cause, or do I just need to use a different video player?

#13

sdmaxey - December 22, 2009 - 22:36

Again: I'm still getting this error with SWFTools 6.x-2.5 when using an input format that doesn't have an attached WYSIWYG editor and has all filters except the SWFTools filter turned off.

Whether my file is a fully qualified URL (which plays in my browser) or a relative link, the error and the "not found" path are the same.

 
 

Drupal is a registered trademark of Dries Buytaert.