Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Upgrading to php-5.3 renders swftools' onepixelout unusable with barking like these:
warning: Parameter 2 to onepixelout_swftools_flashvars() expected to be a reference, value given in /path/to/drupal/includes/module.inc on line 450.
Removing the ampersands from onepixelout_swftools_flashvars()
's definition renders swftools' onepixelout usable again - which is what the attached patch does.
Comment | File | Size | Author |
---|---|---|---|
#29 | swftools_onepixelout-589326-29.patch | 2.01 KB | fuzzy76 |
#21 | swftools-onepixelout-589326-21.patch | 2.89 KB | mtift |
#6 | swftools_2_5_php_5_3.patch | 2.3 KB | AndyF |
swftools_onepixelout-php-5.3.patch | 434 bytes | Boobaa |
Comments
Comment #1
NaheemSays CreditAttribution: NaheemSays commentedTested and this fixes the problem. (Drupal core was also fixed with similar changes in drupal 6.14 I think).
Similar changes will also need to be done for all the modules that use hook_swftools_flashvars.
Comment #2
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedHmm. You learn something new every day!
The hook_swftools_flashvar is written using references because in some cases (e.g. FlowPlayer 3) the module wants to change other things, like the embedding method being used.
I never formally checked at the time I put this in, and it has worked up until now. But now I've done some reading I've found descriptions that warn that module_invoke() can't be used to pass by reference, although that's what I'm doing, and it seems to be working [it is how FlowPlayer3 module can over-ride the default embedding setting mode and force its own]
Similar is described at http://api.drupal.org/api/function/user_module_invoke/6 which is a specific function call for invoking hook_user.
At the moment my test set up is PHP 5.2 (primarily because the Zend debugger doesn't like PHP 5.3), but I will have a go at implementing a version of user_module_invoke as a solution.
I'm puzzled though - the documentation says module_invoke can't handle references, but it seems to be work for me...!!
Comment #3
Stuart Greenfield CreditAttribution: Stuart Greenfield commentedOK - set up PHP 5.3 and yes, it starts to complain.
Rather than remove the pass by reference and break the ability of FlowPlayer3 to over-ride the embedding, which is a necessary capability to support some advanced FP3 things that are coming, I've written an alternative function to call the hook, in a similar vein to user_module_invoke. It's a little simpler because we know the module we're calling.
Upshot is that passing by reference now works without any complaints from PHP.
This code is on branch DRUPAL-6--3 as I anticipate this is where the next release will come from.
To implement the fix manually to an existing SWF Tools installation change line 500 in swftools.module from:
to
and add this new function at the end of the swftools.module:
Note to self - this issue isn't fully resolved yet - there are other calls to swftools hooks (e.g. hook_swftools_playlist) that also rely on module_invoke by are written to receive parameters by reference.
Comment #5
rdgouw CreditAttribution: rdgouw commentedThanks for adding this solution! No complaints by PHP 5.3 anymore.
Comment #6
AndyF CreditAttribution: AndyF commentedAnd the same thing as a patch...
Comment #7
DanWoodbury CreditAttribution: DanWoodbury commentedhi, thanks for the help so far but i still cannot get this to go. the original errors have gone but now i get a new error (in error reports) saying that the system cannot find AC_RunActiveContent.js.
the weirdest thing is that the path shown is depenedent on the video path.
any help would be appreciated
Comment #8
carlitos.10040 CreditAttribution: carlitos.10040 commentedThank you Stuart, this worked.
Comment #9
mathieu CreditAttribution: mathieu commentedSubscribe
Comment #10
dkane CreditAttribution: dkane commentedPatch in #6 worked for me. Thank you andy.
Comment #11
jacobkdavis CreditAttribution: jacobkdavis commentedPatch in #6 worked for me too, thanks Stuart and Andy! Will this be rolled into the next version?
Comment #12
rachawal CreditAttribution: rachawal commentedStuart, thank you very much for providing a clear and concise resolution to this issue. I encountered the same issue, and after I implemented your change, Flowplayer appeared and played videos! Thank you, thank you, thank you!!!
Comment #13
Brian Tastic CreditAttribution: Brian Tastic commentedI used the manual method as described above and that seemed to cure some of the problems. Thanks.
Comment #14
rv0 CreditAttribution: rv0 commentedpatch in #6 works for me
Comment #15
stawil CreditAttribution: stawil commentedStuart Greenfield you are awsome.
your code is saved me.
Big thanks.
Comment #16
John Franklin CreditAttribution: John Franklin commentedAs noted in #907464: Parameter 2 to genericplayers_swftools_flashvars() expected to be a reference, objects are always passed by reference, so there's no need to create a special invoke mechanism.
Comment #17
dbavedb CreditAttribution: dbavedb commentedStu is the man... all this stuff was broken for me all day. Hah I thought I could just work around it (JW player worked, but Flowplayer would not). Thanks!
-PHP/Drupal newb
Comment #18
dmakaridze CreditAttribution: dmakaridze commentedSubscribe
Comment #19
abaddon CreditAttribution: abaddon commentedhad issues with php 5.3 (the error in the logs got me here - my problem was that the 1pixelout players were not stopped when starting another) and the patch in #6 fixed it for me
Comment #20
hefox CreditAttribution: hefox commentedNeeds working based on comment #16; no need to have more code than necessary!
Comment #21
mtiftThis patch, formatted for Git, fixed the problem for me.
Comment #22
Dexter8 CreditAttribution: Dexter8 commentedWorked for me. I edited the following files in swftools module. Remove & symbol for function wijering_swftools_flashvars($action, $methods, $vars)
/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 #23
ryan.gibson CreditAttribution: ryan.gibson commentedFunctionally, #21 cleared up the issue for me. Not receiving the error anymore.
Comment #24
NaX CreditAttribution: NaX commentedIt looks like this was committed to the dev branch in 2010
Ref: http://drupalcode.org/project/swftools.git/commit/2f5cdfafe7870e9162abc1...
Comment #26
benlotter CreditAttribution: benlotter commented#3 worked for me, thanks.
Comment #28
yan CreditAttribution: yan commented#21 works for me, but I'm amazed that there hasn't been a new release since almost five years.
Comment #29
fuzzy76 CreditAttribution: fuzzy76 commentedReroll against latest stable.