Closed (fixed)
Project:
SWF Tools
Version:
5.x-1.1
Component:
SWF Tools
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2007 at 17:20 UTC
Updated:
28 Apr 2010 at 20:57 UTC
First off, thanks for this module. It's been useful in coming to grips with Drupal development.
I believe there is an issue in the 5.x-1.1 version of the base SWFTools module where attempting to set the embedded .swf's id via the 'othervars' parameter causes problems. Specifically, if I attempt to add a .swf to a page in the following manner, everything works fine:
$flashOutput = swf($filepath, $sizeParam);
Where $filepath is the path to the .swf and $sizeParam is something like "460x320". The resulting
tag looks like:<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="320" width="460">
However, SWFTool's swf() function allows one to pass an associative array as the fourth parameter. If one of the array's keys is 'id' that value will be used in the .swf's and tags. At least I think this is what is supposed to happen.
When I change my call to the following: (where $otherVars = array('id' => 'mySwf') in the line shown below )
$flashOutput = swf($filepath, $sizeParam, "", $otherVars);
The resulting tag gets mangled thusly:
<object width="460" height="320"<param name="id" value="chart" />
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">
I've worked around this for our installation by making just a couple changes to the swftools_swftools_embed() function. If indeed this is a bug and not just me using the module incorrectly, would listing the changes (4 lines I think) be sufficient or do I need to go figure out how to make a patch?
Thanks.
Comments
Comment #1
Stuart Greenfield commentedChecked the code on DRUPAL-5 (not tested, but read it), and it looks like the id generation was fixed.
No-one else has report this issue, and thread is now >2 yrs old, so changing to closed as it seems it was fixed a while back!