Closed (fixed)
Project:
SWF Tools
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Sep 2009 at 15:17 UTC
Updated:
19 May 2017 at 08:35 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
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 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 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 commentedThanks for adding this solution! No complaints by PHP 5.3 anymore.
Comment #6
andyf commentedAnd the same thing as a patch...
Comment #7
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 commentedThank you Stuart, this worked.
Comment #9
mathieu commentedSubscribe
Comment #10
dkane commentedPatch in #6 worked for me. Thank you andy.
Comment #11
jacobkdavis commentedPatch in #6 worked for me too, thanks Stuart and Andy! Will this be rolled into the next version?
Comment #12
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 commentedI used the manual method as described above and that seemed to cure some of the problems. Thanks.
Comment #14
rv0 commentedpatch in #6 works for me
Comment #15
stawil commentedStuart Greenfield you are awsome.
your code is saved me.
Big thanks.
Comment #16
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 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 commentedSubscribe
Comment #19
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 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 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.ryan commentedFunctionally, #21 cleared up the issue for me. Not receiving the error anymore.
Comment #24
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 commented#3 worked for me, thanks.
Comment #28
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 commentedReroll against latest stable.