Hello
I have used swftools on other projects, but started a new piece of work, and kept running into some PHP warnings.
warning: Parameter 2 to flowplayer3_swftools_flashvars() expected to be a reference, value given in C:\wamp\www\drupal-6.14\includes\module.inc on line 450.
With the generic viewer, I would get video and audio, but no controls. Using flowplayer3, I would get controls, the whole frame, but the play button wouldn't work.
The only thing I can see being different is that I am using PHP 5.3.0 in my development suite (as part of wampserver), and a single-line in this article: http://php.net/manual/en/migration53.deprecated.php
.
Can anyone else confirm that PHP 5.3.0 breaks swftools, or have I got something else going on?
Thanks!
Comments
Comment #1
timatlee commentedSmall update.. Downgraded wampserver to 5.2.11 and Flowplayer 3 plays without an issue, as does the generic player (though still no controls, which may be by design if I remember correctly)
Comment #2
mariusilie commentedI get the same error. I guess SWFTools is not compatible with PHP 5.3...
Comment #3
irakli commentedI believe, it's Drupal that is not compatible with PHP 5.3 http://drupal.org/node/360605
Comment #4
eaton commentedDrupal 6.15 is compatible with PHP 5.3 save a minor issue with the 'ereg()' function in file.inc. This bug is separate and is specific to the SWFTools package. I'm seeing it on my PHP 5.3 local development setup, too.
Comment #5
naheemsays commentedthe issue is the same as #589326: Make swftools' onepixelout compatible with PHP 5.3 and a quick fix is to remove the & from all implementations of hook_swftools_flashvars($action, &$methods, &$vars) as is done in the attached issue for 1pixelout
in short, search the modules for "_swftools_flashvars($action, &$methods, &$vars)" and replace with "_swftools_flashvars($action, $methods, $vars)".
This will work for all php 5 users, but probably needs testing with php 4 before it can be committed to the cvs and fixed in an official release.
Comment #6
berdirI don't see any changes to $methods/$vars so the change described by nbz should work.
Additionaly, that function contains the following code, and that will only work correctly on PHP5.
Comment #7
vijayg commentedHi Berdir
I am having the same error which you have posted and even i could not see any changes regarding the post of nbz. Berdir, is there any solution you got it. Looking forward from you
Comment #8
vijayg commentedHi Berdir
The whole day i was looking for the solution i was finally land up in a dirty code :
read out this url :http://drupal.org/node/589326
i got the out put
Comment #9
Stuart Greenfield commentedI'll double check tonight, but the fix done in #589326: Make swftools' onepixelout compatible with PHP 5.3 replaced the old way of calling hook_swftools_flashvars() in all modules, so the new DRUPAL-6--3 branch should address the above.
Basically we avoid using module_invoke_all() since we know the player we are calling, so we can call its hook directly and pass by reference safely.
But I will check just to make sure...
Comment #10
Stuart Greenfield commentedChecked and confirmed - this is a duplicate of #589326: Make swftools' onepixelout compatible with PHP 5.3.
The main swf() function has been re-written so it no longer uses the module_invoke_all() call which is what causes the problem. We now call the specific hook_flashvars() function directly, and that way we can safely pass by reference.
Note - pass by reference is necessary since players like flowplayer need to create some flashvars, but also may need to amend the embedding method directly.
This is committed on branch DRUPAL-6--3 pending the SWF Tools 6.x-3.x release.
Comment #11
matthewdades commentedWorked for me! I followed the instructions nbz gave :)
Comment #12
larsdesigns commentedWorked for me by following the instructions on post #5.
The following files were edited:
/sites/all/modules/swftools/flowplayer/flowplayer.module
/sites/all/modules/swftools/flowplayer3/flowplayer3.module
/sites/all/modules/swftools/genericplayers.module
/sites/all/modules/swftools/imagerotator/imagerotator.module
/sites/all/modules/swftools/onepixelout/onepixelout.module
/sites/all/modules/swftools/simpleviewer/simpleviewer.module
/sites/all/modules/swftools/wijering/wijering.module
/sites/all/modules/swftools/wijering4/wijering4.module
Comment #13
andyf commentedI also had the issue that Flowplayer wouldn't play vids with PHP 5.3. I followed Stuart's instructions from #589326: Make swftools' onepixelout compatible with PHP 5.3 and it worked for me (and is a lot simpler than #5). Please note that Stuart warns that the issue isn't fully resolved by this. You can download this patch and see if it works for you.
Comment #14
madhavvyas commentedUse following patch, to solve swftool module problem
http://drupal.org/files/issues/swftools_2_5_php_5_3.patch
Comment #15
yaho commentedGod bless you, dude! :-)
Comment #16
fuzzy76 commentedThis really needs a bugfix release :(
Comment #17
fuzzy76 commentedThe reason for this is a change in behaviour in PHP 5.3.0 that causes warnings on some module_invoke() calls: http://www.php.net/manual/en/ini.core.php#ini.allow-call-time-pass-refer...
The patch by madhavvyas looks like a promising workaround. Another alternative is just to disable the warning in php.ini
Comment #18
geraldito commentedThanks AndyF for your patch linked on comment #13 which worked out perfectly.
Comment #19
aschiwi commentedWorks well, thanks.