Closed (fixed)
Project:
MediaFront
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jul 2010 at 06:11 UTC
Updated:
6 Apr 2012 at 01:28 UTC
In function createCSS() in OSMPlayer.php there are calls to is_dir(), mkdir() and chmod(). My server does not give apache access to chmod, and I get a nasty error about it, yet the css files are created just fine.
I think you ought to look in to the Drupal function file_check_directory() which has a whole bunch of wrappers to ensure the directory is created smoothly. See http://api.drupal.org/api/function/file_check_directory/6
Comments
Comment #1
travist commentedI will probably just need to re-create that function as a class method within the OSMPlayer since that class was built to be used as a stand alone without Drupal. I will see what I can do on this.
Thanks,
Travis.
Comment #2
travist commentedLooking further into this, it seems all drupal really does different from what my library does is just suppress those alarms by placing a "@" symbol in front of the chmod calls. This would basically make the call, but suppress any errors. I will add this to the library which should resolve this issue.
Thanks,
Travis.
Comment #3
backwardgraphics commentedI'm not quite sure how to write a patch but I simply replaced this code at line 431 of /mediafront/players/osmplayer/player/OSMPlayer.php
With this code
Everything Appears to be working properly. Hope this works for others
Comment #4
travist commentedjtsowards,
Thanks for your efforts. But I probably won't be able to put this in. The OSMPlayer.php was built to be used as a stand-alone ( without Drupal ). This would break the stand-alone installations since this has a dependency on Drupal.
I will commit a version tonight that puts the "@" in front of the "chmod" calls and hopefully that fixes this issue.
Thanks,
Travis.
Comment #5
travist commentedThis should be fixed in BETA3. Please let me know otherwise.
Comment #6
hatsch commentedi am reopening this because since beta3 i am experiencing problems with the paths generated by mediafront. switching back to beta2 solved the issue!
here's the bug i encounter:
all paths generated by mediafront look like this
[BASE_URL][ABSOLUTE PATH] http://example.com/var/www/example.com/sites/example.com/modules/......
all images loaded from css and the osm player swf don't get loaded because of this
html5 playback is working, but there are also no icons showing.
when i use osmplayer-beta2 together with mediafront-beta3 everything works again.
maybe it is relevant that i use symbolic links for my sites directory.
i hope that these bug are somehow related.
Comment #7
mstrelan commented#4 - I thought it might be something like this, but I guess now there is no warning if it fails. I would suggest code as below.
#5 - No more nasty errors!
#6 - This should be a new issue I think
But then again that is Drupal specific, so I guess maybe you could return TRUE if it was created and FALSE if it wasn't, then do the watchdog() call from your module
Comment #8
travist commentedmstrelan,
Thanks for your previous post. But looking at that code might defeat the purpose of chmod altogehter. is_writable checks if the folder is writable, and if not, then skips over that. The point of the chmod is to make sure the folder is writable. I am thinking I can use your code above, but without the is_writable. Because the chmod has the @ in front of it, it will fail silently to which I can then return false and add it to the watchdog in that case.
Let me know if this works for you.
Thanks,
Travis.
Comment #9
mstrelan commentedNo problems
Comment #10
enjoylife commented