Closed (fixed)
Project:
SWF Tools
Version:
6.x-3.0-beta4
Component:
SWF Tools
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2010 at 17:14 UTC
Updated:
16 May 2010 at 06:14 UTC
My current installation of SWFTOOLS begun to spit out this error:
warning: preg_match() [function.preg-match]: Unknown modifier 'p' [..]/swftools/swftools.module on line 1512
Where "[..]" is the full path to the module in my server.
A) It happens at random, or so it appears. Usually page reloading will trigger it.
B) I am on PHP 5.3
C) The error happens in any page, even administration pages, though it only suppose to load on specific ones.
D) Changing to footer instead of header does not solve the problem.
E) The error seems to accumulate: If I reload the page sometimes I get the same error up to 4 times within the page.
Any leads to a solution would be highly appreciated.
Comments
Comment #1
Stuart Greenfield commentedThat doesn't sound good - and I've not seen this locally. How are you putting your swf content on the page, and are you using a public or private file transfer? Code around that point of the module is associated with private transfers.
I'll run some tests tonight and see if I get the same.
Did this error occur immediately after installing the beta, or did it start later?
Inconsistent appearance might be the case if the browser is caching the swf locally so it doesn't fetch it back from the server?
But then I have no idea why the error should appear on admin pages when there's nothing for SWF Tools to do.
Leave it with me!
P.S. I'm afraid you get the dubious honor of first bug filed against the new version of SWF Tools!
Comment #2
3rdLOF commentedHey Stuart:
First of all, kudos with the attitude. Man, how refreshing. Almost makes me want to find another bug.
And second:
I am building a custom video gallery using lightbox2 with flowplayer3 as its media player. Right now I am ONLY testing a Quicktime/h.264 files, which is being handled by flowplayer's js to play using the built Quicktime.
Also, as addition to the stuff above, I notice the error often pops after clearing the caches (all of them).
Comment #3
Stuart Greenfield commentedI don't get this locally, and the content of swftools.module at line 1512 is just the closing brace on a function.
In that area is the function to let SWF Tools serve files not uploaded via an upload module, and there's a preg-match at line 1488
In total the code around this area should be
functionis on line 1471, and the closing}is line 1512 where your error is reported. There is a preg_match in line 1488.Can you check your swftools.module in a text editor and verify that the ID at the top says
swftools.module,v 1.20.2.16.2.38 2010/03/30 00:02:01 stuartgreenfieldThen check that your code around these lines matches. I did have an issue way back when a package got corrupted and users had bits of an old module. No-one else has reported issues, but you never know.
Locally I'm running the CVS code from the tag that generated the package and it's fine.
I've placed an mp3 file that I didn't upload and can't acces it at first. When I enable SWF Tools to let me access the file it plays fine and I get no errors. If your package is not corrupted then I can't see why you're getting an error, and not at that line.
If the preg_match is going wrong (although the line number is wrong!) then the only other thing I can suggest is to try and find out what the regex string is.
To do this add the following lines in swftools.module right underneath global $user in the above function, so it reads
Now clear your site cache (Administer > Site configuration > Performance > Clear cached data). Then view a page with some audio/video, then view again. You should get a green message box with the regex string in it. Can you paste what you see.
On my test site I get
/\.(swf|flv|xml|mp3|jpg|jpeg|png)$/i. That way we can make sure you're getting a valid string.I was just about to hit Save on this when I realised you said you are playing back QuickTime/H.264 files. Have you realised there are a few tweaks needed?
You need to add the appropriate file extension to SWF Tools list of extensions that it can allow access to (e.g. m4v). But then you will also need to amend the function above so it knows how to serve an m4v file. Add it like this:
Finally, and I'm guessing you've worked this out, SWF Tools doesn't know what to do with an m4v without some help, so you need to pass it the action 'swftools_flv_display' so it knows to send the video to the appropriate player.
So there's quite a lot to go through here! First to understand why you get an error report at a line that doesn't have a preg_match in it, and then you need to tweak the module to support m4v, if you haven't done so already.
Comment #4
3rdLOF commentedWell, I shamely must admit this error perhaps was due to a botched upgrade. I uninstalled and reinstalled it and it seems the error had disappear.
That said, your post extended your help by pointing out to the issue with Quicktime. I had chosen Flowplayer because I was under the impression it would automatically handle FLV and Quicktime WITHOUT having to do any modifications to SWFTools (tunnel thinking hide the obvious).
I will try this information you gave on the Quicktime and see what pans out.
Thanks.
Comment #5
Stuart Greenfield commentedBotched upgrade - so it's not just me that does them :-)
No problem - although SWF Tools is just a hobby for me I actually quite like the trouble shooting (my regular job is as an engineer so it must be in my nature).
FYI - I am just finishing an upgrade to the SWF Tools admin page so you will be able to extend the association of extensions with actions, and add new mime-types, without having to hack the module. So you'll be able to make the changes described above simply by editing a settings page. That'll be another feature request off the list.
Comment #6
3rdLOF commentedWow.
I got your information on how to add the mv4, but I am stumped on the "pass it the action 'swftools_flv_display" as I think that is a bit above my rank.
Should I just wait for you to finish this new upgrade or should I try to mod this myself (keeping in mind the potential to wear you down with questions)?
Comment #7
Stuart Greenfield commentedYour timing is perfect. I am just about to commit the first part of the extension handling code to CVS. It will be available from the development snapshot later.
In the short term, don't worry about the assignment. Go to Administer > Site configuration > SWF Tools > File handling, and in the File handling section set "Default player for a series of mixed media files:" to JW4 or FP3. When SWF Tools doesn't recognise an extension it automatically gets passed to the "mixed media" handler as a fallback.
Once the package generates and you've installed it simply go to Administer > Site configuration > SWF Tools > File handling and open the new "Advanced settings" section. You can now explicitly associate m4v with video by adding the extension m4v to the list to associate with video.
There'll be another commit later (hopefully) to handle the mime-type stuff.
Comment #8
Stuart Greenfield commentedChanging this to fixed as the issue described is resolved by a re-installation of the module.
Comment #10
glasswool commentedIf I embed at the end of a text line using [swf file="abc.mp3"], the player always displays on the next line, how do I theme so that the player is embedded on the same line?
Comment #11
glasswool commentedpls ignore, display:inline; solved my problem.