I checked that .swf files are being sent to the proper directory files/flash.
Although the flash player area is generated on the page, it allways shows white.
Is there any problem related to multisite drupal installations (Drupal 5.1)?

Comments

Stuart Greenfield’s picture

I've not tried the module on a multi-site installation so I would need to test this to see if there are any issues there.

Do you have a link to a page that isn't working? Alternatively, can you take a look at the source code for a problem page and paste the contents of the flash div - it will look like this:

<div id="ufo-1179338530-1" class="flash">
  <p>You are missing some Flash content!</p>
  <p>Maybe your browser does not have javascript enabled, perhaps you don't have the version of Flash this content needs (it needs at least version 6), or perhaps the content hasn't initialised correctly. Please check your settings and then try again. Thank you!</p>
  </div><script type="text/javascript"> var FO = { movie:"/files/flash/some_movie.swf", width:"320", height:"240", majorversion:"6", build:"0", xi:"true", ximovie:"/modules/flashnode/ufo.swf" }; UFO.create(FO, "ufo-1179338530-1"); </script>

That might shed some light.

tritao’s picture

Sure, here it is:

You are missing some Flash content!

Maybe your browser does not have javascript enabled, perhaps you don't have the version of Flash this content needs (it needs at least version 6), or perhaps the content hasn't initialised correctly. Please check your settings and then try again. Thank you!

var FO = { movie:"/test/tintadachina//usr/www/users/tritao/test/sites/www.anetsimples.com.test.tintadachina/files/flash/cvd_001_3.swf", width:"500", height:"330", majorversion:"6", build:"0", xi:"true", ximovie:"/test/tintadachina/modules/flashnode/ufo.swf" }; UFO.create(FO, "ufo-1179358572-1");
tritao’s picture

Here's the properly formated code:

    <div id="ufo-1179358572-1" class="flash">
  <p>You are missing some Flash content!</p>
  <p>Maybe your browser does not have javascript enabled, perhaps you don't have the version of Flash this content needs (it needs at least version 6), or perhaps the content hasn't initialised correctly. Please check your settings and then try again. Thank you!</p>
  </div><script type="text/javascript"> var FO = { movie:"/test/tintadachina//usr/www/users/tritao/test/sites/www.anetsimples.com.test.tintadachina/files/flash/cvd_001_3.swf", width:"500", height:"330", majorversion:"6", build:"0", xi:"true", ximovie:"/test/tintadachina/modules/flashnode/ufo.swf" }; UFO.create(FO, "ufo-1179358572-1"); </script>
Stuart Greenfield’s picture

I will have to do some investigation at my end...

This looks right...
ximovie:"/test/tintadachina/modules/flashnode/ufo.swf"

but this looks wrong...
movie:"/test/tintadachina//usr/www/users/tritao/test/sites/www.anetsimples.com.test.tintadachina/files/flash/cvd_001_3.swf"

/test/tintadachina/files/flash/cvd_001_3.swf would perhaps make sense!

Leave it with me - I'll see if I can find out what is going on!

tritao’s picture

Ok, thanks a lot!

Stuart Greenfield’s picture

I have some thoughts as to what might be going on here.

I need to check a setting with you - what do you have as your file system path (from Administer > Site configuration > File system)

Also, is your site configured for public or private file transfers?

I think the error is to do with the way that flashnode constructs paths, and I think it might not be handling private settings / file system paths that are not off of the main directory.

Thanks.

tritao’s picture

My file system path is:
/usr/www/users/tritao/test/sites/www.anetsimples.com.test.tintadachina/files

and the site is configured for private file transfers.

Hope this helps.

Stuart Greenfield’s picture

I have some thoughts on this, but before changing anything are other uploads/downloads working ok on your site?

In your site structure where does the files folder sit?

Have you got

web root (Where index.php sits)
|_________files
|_________modules
|_________themes etc?

The file path you are using is a full path which is why flash node is struggling - the path it constructs for the movie is "wrong" as it builds up from base_path() + file_create_path()

The swf replacement is working as you said you get the empty box for it, and that is loaded from /test/tintadachina/modules/flashnode/ufo.js. That path is build with a similar method, so the /test/tintadachina/ part is correct.

If your files are at /test/tintadachina/files, and your flash is at /test/tintadachina/files/flash, then do you need to use the full path in your file system path, or can you just set it to files - Drupal should be able to resolve that to the proper location as you appear to have the correct base_path setting.

The full path you have looks as though it points to files rather than somewhere outside of your web directory. Normally a full path is only needed if your files reside somewhere other than just off of your site's root.

The bug you have identified does mean that flashnode will (at the moment) not work with paths that fall outside the "normal" location. This would most likely occur if you also use private file transfers, and I know flashnode doesn't work with that!

If using just files isn't an option for some reason then you could try altering the flashnode module. Try changing this part of line 566 from

'!movie' => base_path().file_create_path($file['_flash'])

to

'!movie' => file_create_path($file['_flash'])

That will prevent /test/tintadachina/ being put at the start of the movie path.

I have to admit I'm not that well up on pathing, but I think you might also need to change your file system path to start with //, a single / might be interpreted as a path relative to site root again, in which case it still won't work. I'm also not sure if this path will even work, but I don't have a set up locally with which to simulate it I'm afraid.

Let me know if any of the above help. I do have a third option, but that will mean re-writing the relevant part of flashnode, and it will only work if you files are located off of your site root as it will construct a full url. Given that will only work for a files just off the root then it should be possible to get flashnode working without modification!

Please post again if this does/doesn't work!

tritao’s picture

Indeed the files' download method was set to private, but I hadn't pointed it to a directory outside my web directory...

Anyway, I guess in this case I won't really need files to be private, so I changed the path to this:
sites/www.anetsimples.com.test.tintadachina/files
and checked it public, and now it works!

As for the patch, I prefere to wait for another version of the module and avoid to brake the site on future updates.
That is, if you're thinking about doing one ! :) , I hope so, being such a useful module!
I did try to patch the way you said it, just to inform you about the result, but didn't find that code were you said (line 566?).

Thank you very much!

Stuart Greenfield’s picture

Status: Active » Fixed

You should find that if the module is now working you can now switch on private file transfers. If using private transfers on a site where the files folder is actually in the web directory then someone could, if they wanted, find the file. It is just a little more difficult.

As it stands flashnode doesn't actually respect the public/private file setting (although I think your problem has highlighted that it won't currently support files outside the web directory)

I don't intend to fix this in the current version of flashnode, and the next version will be using SWFTools to provide swf insertion and that has its own file handling mechanism.

Finally, yes, there will be a new version of flashnode once SWFTools makes an official release. This will include some new features, like user definable replacement content.

Glad you got your site working!

Anonymous’s picture

Status: Fixed » Closed (fixed)