Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I just realized that the following error message in a "red box" always appears at the top of contents at various pages:
Could not display the flash because does not appear to exist.
Everything is functional though, but looks like a minor bug in the code.
Comment | File | Size | Author |
---|---|---|---|
#49 | spaces.patch | 1.84 KB | DaRK-1 |
Comments
Comment #1
travist CreditAttribution: travist commentedWhaaaaa?????! Never even heard of this before. What module are you using to actually display the Flash contents? FlashVideo does not print anything out like this. You might have a module collision.
Comment #2
spiffyd CreditAttribution: spiffyd commentedSince you say FV doesn't produce that msg in the code, then definitely its another module. Thanks for the heads up. I am debugging right now.
Comment #3
spiffyd CreditAttribution: spiffyd commentedTurns out it was the Image module. Strange!
Comment #4
rosgar CreditAttribution: rosgar commentedI dunno, but i think it's a 'flash node module' error. A conflict with the swf tools.
Comment #5
stoltoguzzi CreditAttribution: stoltoguzzi commentedsame here, as soon the SWFTool is switched on (only the base-module) I got this message
Comment #6
spiffyd CreditAttribution: spiffyd commentedI realized that with FlashVideo, there's absolutely no need for SWF Tools -- which is buggy - if you only want to display videos, Flash Video by itself works great, even if you don't have FFMPEG.
Speaking of conflict with SWF Tools, I wonder if the following is the result of such a conflict:
For some reason, I cannot change the width and height of my flash video player (with FlashVideo module). I've tried changing dimension settings in both custom FlashVars and FFMPEG settings input - neither does the trick, it always stays at 425x344. All else is fully functional.
So when I looked at my HTML output, I see the following:
425x344 was specified between the EMBED tags! I've looked all over my FlashVideo settings and don't see any way to change this.
The reason I suggest that this may be a conflict with SWF Tools is b/c I recall previously inputting 425x344 in the JW Player Config (or some other setting) associated with the SWF Tools module. Perhaps these values did not properly get removed from the database on uninstall?
Any suggestions on how to resolve this issue much appreciated!
Comment #7
Tony_Deep CreditAttribution: Tony_Deep commentedUpdating SWF tools from 5.x-2.1 to 5.x-2.2
(with Flash Node 5.x-5.4 updated to 5.x-5.5)
as you see, flash files are in files/flash directory.
http://drupal.org/node/297337 not of help...
Also http://drupal.org/node/243343 not of help too, because when importing a new file (via ftp), the node is created but shows the same message.
when reverting to 5.x-2.1 (and Flash Node 5.x-5.4), everything works back fine.
Any suggestions ?
Comment #8
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedCan you confirm what you are trying to do - play back an flv you uploaded via flash node? Playback an flv from an swf filter?
The problem looks to be an extra 'files' at the start of the file path.
Comment #9
Tony_Deep CreditAttribution: Tony_Deep commentedthanks Stuart for your swiftness, the answer is...
- play back flv already uploaded via flash node prior the upgrading to both swf 5.x-2.2 & flashnode 5.x-5.5
But after upgrading, when trying to upload, flash node imports the file but says the same in the node:
Could not display the flash because "files/http://mysite.com/files/flash/myflash.flv" does not appear to exist.
Comment #10
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedAre you saying that existing content plays, but that new content doesn't, and you get this error when uploading new files?
Or do you get this error for all content, both things you created before upgrading and those you created after?
Comment #11
Tony_Deep CreditAttribution: Tony_Deep commentedI'm getting this error for all content, both things I created before upgrading and those I created after.
So I get the message for any content, before and after upgrading.
Comment #12
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedI can't create this error locally. There aren't that many changes between each version of flash node / SWF Tools.
You can "mix and match" between flash node 5.x-5.4/5.5 and SWF Tools 5.x-2.1/2.2. So can you try flash node 5.x-5.5 with SWF Tools 5.x-2.1, and flash node 5.x-5.4 with SWF Tools 5.x-2.2 to see if any of those combinations work, or fail.
That might help determine if it's something about flash node, or something about SWF Tools that is causing the hiccup. That said, all combinations appear to be working here.
I've also tried with both public and private file systems in case that is the issue, but again all working fine.
Comment #13
marantz CreditAttribution: marantz commentedI'm seeing the same issue creating new FLV nodes with SWF Tools 6.x-1.3 and Flash Node 6.x-2.2 on Drupal 6.4. I can't test with existing content (because I've just installed these modules).
Flash Node is passing the right values to swf(), but somewhere inside swf() or in something called from swf(), there seems to be a broken reference. I also notice that, though the file reference gets lost, the file directory path remains.
Switching off "Check if local files exist" lets me grab the following embeding code from FlowPlayer, which has the file directory path (but no file) showing up:
<embed src="http://localhost:8888/FAST/sites/all/modules/swftools/shared/flowplayer/FlowPlayerClassic.swf?config=%7Bembedded%3Atrue%2CbaseURL%3A%27http%3A%2F%2Flocalhost%3A8888%2FFAST%2Fsites%2Fall%2Fmodules%2Fswftools%2Fshared%2Fflowplayer%27%2CvideoFile%3A%27http%3A%2F%2Flocalhost%3A8888%2FFAST%2Ffiles%2F%27%7D" width="960" height="720" scale="noscale" bgcolor="111111" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" allowNetworking="all" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
I had no luck tracking down the broken reference, but I'm completely unfamiliar with the code. Let me know if you need more information or if you have any hints on where I might look to find where a) SWF tools checks if local files exist, and b) flowplayer gets its value for videoFile.
Comment #14
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedThis is really strange - I just tested with my local set up (Drupal 6.4 / SWF Tools 6.x-1.2 / Flash node 6.x-2.2) and it's ok! I tried with Wijering 4 and FlowPlayer just in case it was player specific.
What also puzzles me is that the code posted in #13 doesn't actually look like SWF Tools code. The embed src has all the config parameters attached in a query string after the ?, but SWF Tools uses flash vars to pass the data, and there is no flash vars string set. A lot of the other SWF Tools parameters also seem to be missing (no setting for quality, no setting for base, while allowNetworking isn't a parameter that normally gets passed at all!
What embedding method are you using?!
Comment #15
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedTo help with debugging in SWF Tools 6.x-1.2 add the following between lines 340 and 341 of swftools.module:
drupal_set_message('File is '.$file);
In SWF Tools 5.x-2.2 the same code, but between 309 and 310.
That will cause a message to output when the flash node is rendered and it will give you the file path.
If you are using the latest flash node you should see a fully formed url that is the path to the file (the flv file, not the media player).
E.g. on my test set up I get http://localhost/drupal6/files/flash/test.flv
Comment #16
Tony_Deep CreditAttribution: Tony_Deep commentedIn SWF Tools 5.x-2.2, putting the code [drupal_set_message('File is '.$file);] in line 310, gave me the correct location url of the file.
Viewing the node:
File is http://mysite.com/files/flash/myflash.flv
Could not display the flash because "files/http://mysite.com/files/flash/myflash.flv" does not appear to exist.
...
Comment #17
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedGreat (kind of). That says that flash node is working properly since it supposed to provide a full path to SWF Tools. So it's SWF Tools that is getting a bit confused and for some reason is trying to validate an already valid path. That explains the extra 'files' when you see the message.
So at least I know where to try and start debugging, although like I said, it is working ok for me already!
Comment #18
Tony_Deep CreditAttribution: Tony_Deep commentedbut, Stuart, as an answer to your post # 12:
flash node 5.x-5.4 with SWF Tools 5.x-2.2.... works !!
but not flash node 5.x-5.5 with SWF Tools 5.x-2.1
Comment #19
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedJust to be clear:
Flashnode 5.x-5.4 and SWF Tools 5.x-2.2 = Works
Flashnode 5.x-5.5 and SWF Tools 5.x-2.1 = Doesn't Work
Flashnode 5.x-5.5 and SWF Tools 5.x-2.2 = Doesn't Work
??!!??
Looks like I'm going to be busy this evening!
Comment #20
marantz CreditAttribution: marantz commentedTo clarify, the code I posted is the embed code generated by flowplayer when I select embed from its built-in menu. I just posted it to show that it was getting the files directory path but not the FLV file's path.
Comment #21
Stuart Greenfield CreditAttribution: Stuart Greenfield commented@marantz - I'm still not sure what you are referring to! Is the code sample you posted "live" code from your page that isn't working, or code from somewhere else?
Can you post the mark up that is actually being produced by the SWF Tools / flash node combination - thanks.
Comment #22
marantz CreditAttribution: marantz commentedThere's the code straight from the page. The previous code was from clicking in the lower right corner of the flowplayer box and selecting "Embed." from the menu that pops up. Sorry about the confusion on where that came from.
Comment #23
Stuart Greenfield CreditAttribution: Stuart Greenfield commented@Tony_Deep
I think I can see what is happening, but not why!
First, can you try adding this debug line immediately after the line you added in the previous test...
drupal_set_message(valid_url($file, true) ? 'Valid url' : 'Not a valid url');
I suspect you are going to see 'Not a valid url' but can you confirm.
The upshot is that if SWF Tools doesn't think the url it receives is valid then it assumes it has been given a reference to a file, so it adds a reference to the file path, hence the extra 'files'.
In flash node 5.x-5.5 the code that calls SWF Tools was changed from sending a partial path to a complete path in order to ensure it worked properly with some other SWF Tools settings.
This shouldn't matter, and it works for me here. If SWF Tools gets a full path it skips any checks (or at least it should). If I simulate locally that the full path is invalid then I get the extra 'files' too - the behaviour you are seeing.
But I don't understand why your set up doesn't interpret the path correctly - SWF Tools just calls the built in
valid_url
function. In fact, the path itself is built by another Drupal function,file_create_url
!I will need to test some more to try and work out why this is test is failing as it's the only thing I can see that is the issue, particularly as the first debug test showed that flash node sent a proper path!
Comment #24
Stuart Greenfield CreditAttribution: Stuart Greenfield commented@Tony_Deep
A sudden thought - does the filename of the file you are trying to show contain any 'special' characters - e.g. spaces, apostrophes. Looking more closely at the functions, and testing locally, if I upload a file with a name like My movie.flv (note the space) then it works under flash node 5.x-5.4, but not 5.x-5.5.
Comment #25
marantz CreditAttribution: marantz commentedAha! That cured it for me. I had a space in my test file's name. When I rename it to remove spaces and re-upload it works.
(However, I have the feeling, before too long, I'll be running into other members of our staff uploading files with spaces because it works everywhere else.)
Comment #26
Stuart Greenfield CreditAttribution: Stuart Greenfield commented@marantz - thanks for posting so quickly as this confirms the issue I think. I have now tested using filenames with spaces and can create this issue.
The reason I wasn't getting the error at first is because I've been running tests locally with private file handling. With that enabled the spaces in the filename get properly encoded and everything works. If I change to public handling, and switch off the checks for local files, then I get exactly the results that you have found.
I am just thinking around the best way to fix it. There are a few places where the filenames get encoded so I need to find the "right" way to do it so the encoding doesn't get encoded...
In the meantime, avoid using filenames with spaces!
Comment #27
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedOK - part I of a fix is done - this mends flash node so that if you happen to use a filename with a space, and you are using public downloads, then any spaces are encoded as %20, and then flash node works properly with SWF Tools.
I have quickly tested locally flv, swf and m3 against public and private downloads, using each player, and the combinations seem to be working.
Part II of the fix will need some work in SWF Tools to handle file names that have spaces in coming from the input filter, but that's for another day.
The flash node fixes are available from flash node CVS branches DRUPAL-5--3 for flash node 5, and from HEAD for flash node 6, if you don't mind testing them!
Comment #28
balajana CreditAttribution: balajana commentedhi all,
i found an alternative solution for this.I have just modified the coding in the swftools.module file.
just include the media url coding as given below:
function swftools_get_media_url($path, $is_file = TRUE) {
$media_url = trim(variable_get('swftools_media_url', ''));
$media_url = "sites/default/files" ;
// We do nothing with a remote media file.
if ($media_url) {
return $media_url . '/' . $path;
}
if (variable_get('swftools_check_media', TRUE) && $is_file) {
if (file_exists($path)) {
return file_create_url($path);
}
else {
drupal_set_message(t('Could not display the flash because %path does not appear to exist.', array('%path' => $path)), 'error');
return FALSE;
}
}
I am sure this will work fine.
Thanks
Balaji
Comment #29
IrishGringo CreditAttribution: IrishGringo commentedi am getting the same problem in d6.10, with all the swf shared items loaded.
Comment #30
nebajoth CreditAttribution: nebajoth commentedI am also getting this same problem in d6.10, with a file with no spaces in it.
Comment #31
cybernostra CreditAttribution: cybernostra commentedSame problem but resolved :
at the message error : "Could not display the flash because does not appear to exist."
I rewrite the full url path within the
<swf>
tag from<swf file="/mydirectory/sites/default/files/audio/Some-Skunk-Funk.mp3">
to
<swf file="http://www.mysite.net/mydirectory/sites/default/files/audio/Some-Skunk-Funk.mp3">
may be it could help...
Comment #32
eoneillPPH CreditAttribution: eoneillPPH commentedI am having this problem no matter which player I use, with a file whose path is absolutely correct. All read permissions are open, etc.
Three players load up just fine (1pixelOut, generic, JW Media Player 4), all report in their various ways that this file does not exist. It looks like only the generic player, shown above, sticks the "&autostart=false" on the end of the file path. The 1PixelOut player renders:
I also have the node show the file link for downloading. That path is completely correct, and clicking returns "page not found" while trying to do the download (right-click->save link as) simply fails silently.
Drupal 6.10
SWF Tools 6.x-2.4
Maybe fixed with -dev or 2.5????? Maybe, since link is correct, there is something in File Upload that is foobaring the actual file data?
Comment #33
byant CreditAttribution: byant commentedWhy when in Firefox 3.0.11, besides my flash content also show this
but in IE it odesn't show up
what's wrong, I use SWFTools 6.x-2.5 (direct embedding) and my themes is waffles?
Comment #34
DrupalYedi CreditAttribution: DrupalYedi commentedTry to embed the code into another node. If the messages "Could not display the flash because does not appear to exist." doesn't appears there - then there is an easy way - works for me:
Delete the node where the message appears and create a new one with the same content.
Then the message doesn't appears again. Works for me with drupal 6.14 and SWF Tools 6.x-2.5
Comment #35
anrikun CreditAttribution: anrikun commentedI'm experiencing this bug too.
I can't believe that it exists since August 19, 2008 and has not been corrected yet.
Comment #36
pokadan CreditAttribution: pokadan commentedFor me (SWFTools 2.5) using jw player 4 , the video filepath got picked up from the field. However I had a harder time putting in the preview image. Here's the code :
these than get sent to the node template where they are used within
print swf(...,...)
Comment #37
anewbie CreditAttribution: anewbie commentedFor my case, I recently upgraded my Drupal with security patch 6.15 (original 6.14) and then all SWFTools not working with a message "Could not display the flash because .......".
With Firebug, I found this one "swfobject.embedSWF("http://localhost/drupal-6.14/http://localhost/drupal-6.14/sites/all/modu...". Obviously site name duplicated.
Then in "admin/settings/swftools/embed" (i.e. SWFTools >>> Embedding settings), I found that
"SWFObject 2 - JavaScript" was enabled.
Instead, I enabled
"Direct embedding - do not use JavaScript replacement"
Then the SWFTools players all work again.
Hope this might help some of you.
Comment #38
flaviovs CreditAttribution: flaviovs commentedI experienced this issue today. I managed to solve it by changing:
To:
Comment #39
Stuart Greenfield CreditAttribution: Stuart Greenfield commented@flaviovs
There is a problem in 6.x-2.5 that will cause files starting with a / to not work.
This is addressed in 6.x-3.x which will properly handle a local path in that format.
Comment #40
flaviovs CreditAttribution: flaviovs commented@Stuart, thanks for the info, though I need to ask you if is there any chance to release a 2.x with this issue fixed? I usually refrain from using -beta version on production sites, and a fixed 2.x would be nice. Not a big deal though as we are already aware of this bug and have the workaround.
Comment #41
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedThe 3.x release is THAT close to being ready that I don't plan a 2.x first as 3.x will follow so closely behind.
If you are ok with working around yourself for now that's brilliant.
The 3.x release is going to be awesome (well, I think so). Performance is dramatically improved, and there are lots of great new features to play with.
I reckon one week, maybe two, before 6.x-3.x arrives...
Comment #42
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedSetting to needs review as I think this issue is addressed in 6.x-3.x which is due soon.
The fix is in place in BETA4 and DRUPAL-6--3. I won't go back and fix 6.x-2.x at this time as 6.x-3.x will replace that shortly.
Comment #43
joshuautley CreditAttribution: joshuautley commentedI tried Beta4 and that is when i first encountered this error. I'm switch back to the 6.x-2.5 version since I can not fix it with the above info. NOTE: If you provide a fix, please provide location of file and line number to apply fix to.
Comment #44
satavtar CreditAttribution: satavtar commentedThanks Stuart, it was just right a path problem in my case :)
Comment #45
moxwai CreditAttribution: moxwai commentedI actually solved this one by enabling clean urls. Firebug revealed the swf file trying to play from a location without the /?q=
Comment #46
publicmind CreditAttribution: publicmind commentedAny updates on this issue, it seems like files with spaces are not being handled correctly with 6.x-2.5 as well.
Cheers,
Comment #47
gibbet CreditAttribution: gibbet commentedHey I was having the same issue... found that changing permissions to 777 on the files/flash directory or doing a chown to www-data solved the problem, not sure why... but i decided to go with the second option as i'd rather not 777 the directory
Comment #48
glenshewchuck CreditAttribution: glenshewchuck commented#46's comments still valid - spaces in filenames not working.
Comment #49
DaRK-1 CreditAttribution: DaRK-1 commentedafter a bit of debugging, tracked down the issue to be with valid_url() failing when the url has specialchars like spaces in swftools_get_url_and_path()
The main change being urlencoding the path before running valid_url.
Also for filepath, its was just removing the base_path(), added a case for when the base_path is just /.
Attached a patch which also includes the fix for php 5.3 compatibility.
Comment #50
jham CreditAttribution: jham commentedflv files do not work with spaces. #49 appears to fix the problem.
Comment #51
davemybes CreditAttribution: davemybes commentedIn my case, I was using a field that stored the path and filename of the SWF file, which was then used in the tpl file with the swf($filename) command. I had stupidly set a default value for this field, thinking it would be easier for the client to not have to remember the whole path. So, of course, when the client didn't need a video, they just ignored the field, leaving the default value there. This then caused swftools to not find the file and throw out that error. Stupid problem, I know, but maybe someone else made the same mistake, so I'm posting here just in case.
Comment #52
nsuit CreditAttribution: nsuit commentedI just discovered that I have the same exact problem with our website with audio files and SWF Tools 6.x-2.5, but only on IE / Windows 7. It works on all other browser (e.g. Firefox). The file path swf($path, $args) is an absolute URL to an external file. There are no spaces in the file name (e.g. 008.mp3). The only 'special' character is an underscore in a folder name as part of the URL. I get the "You are missing some Flash content ..." message if I leave away the arguments swf($path) and get a square with the red cross if I leave the arguments in. Does anyone know if #47 works and if I have to change the permissions on the innermost folder?
Comment #53
drurian CreditAttribution: drurian commentedIs there a patch for 6.x-2.5 similar to #49? I've just run into the same issue after upgrading some modules.
Comment #54
hoangbien CreditAttribution: hoangbien commentedHello,
I have the same problem. can you help me? How to fix it?
Thank you,
Comment #55
fuzzy76 CreditAttribution: fuzzy76 commentedWhy on earth is this a user message anyway? It should be a watchdog event.