Upgrade to Drupal 6
designerbrent - July 8, 2008 - 13:13
| Project: | SWFObject API |
| Version: | 6.x-1.0-alpha1 |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | Mark Theunissen |
| Status: | closed |
Description
Do you have any plans to grade this to Drupal 6? Would you accept patches for the module?

#1
If you haven't created it already, here's a patch for swfobject_api port to 6.x. Let me know if this works for you (worked fine in my testing).
--Jon Duell
#2
head seems completely b0rken.
#3
What do you mean? Does the patch not apply for the HEAD version? Or Is HEAD itself broken?
#4
HEAD itsefl is broken and the mentioned patch won't fix it.
problem is the settings-page / variable_get. (already reported)
also it seems that it mixes up the default parameters. for instance in some lines it refers to the express-option, although it should refer to the version.
I've rewritten both, the settings-page as well as the theme-method (has a lot of new parameters now), so old code won't work with my one, if you go with the syntax in the readme. but it works better now. at least for my purposes ;)
#5
Hi-
Can you redo your patch using DRUPAL-5 if your 6x branch is using the 1.5 release of swfobject? The version you patched against is somewhat old.
thanks!
a.
#6
@arthurf
Here's my patch against the DRUPAL-5 branch.
Thanks,
Jon
#7
Ok, I created the DRUPAL-6--1 branch, so you can check that out and see if it's working for you. I don't have a 6 install setup at the moment, but I'll try to test shortly. Thanks very much for this patch, it's great to have people helping out!
#8
@arthurf: I Can't seem to find the DRUPAL-6--1 branch. Do you know where i can find it?
#9
@designerbrent You can grab it from the CVS repo here: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/swfobject_a... or you can just check it out with a CVS client
#10
@arthurf: thanks. Do you plan on creating a release?
#11
Here's a downloadible port to Drupal 6.
#12
Just a quick note that this module rocks....
#13
Just a note to anyone using greenSkin's .zip in #11, there's a runaway "print" statement in the function theme_swfobject_api which prints the text "Array" next to the flash! The line is "print $params;" on 112. Just remove it and everything should work.
Thanks for the module everyone! :)
#14
It would be nice to have a patch from HEAD/DRUPAL-5--2 instead of just a zip ;-) .
#15
I think the zip is the same as the patch but i"m not sure.
#16
I've found another bug - the 6.x zip in #11 doesn't work in Internet explorer. The problem is that IE can't parse Javascript when the last element in the list has a comma after it like this:
var params = {
width: '760',
height: '210',
no_flash: 'Sorry, you need to install flash to see this content.',
version: '5',
type: 'movie',
bg_color: '#FFFFFF',
};
Note bg_color: '#FFFFFF',
You can fix this around line 146 of swfobject_api.module. Just don't output a comma on the last parameter.
#17
That is correct, Mark. We found that recently and I would make a patch, however, the version that I have has several other hacks in it to suit my needs. When I get a chance, I need to fix that. Maybe I'll just and just get the relevant code out that we did for this update.
#18
Ok, sure thing. I have checked the contents of the .zip file against the DRUPAL-6--1 branch and they are indeed different.
I wouldn't mind helping out reconciling the two, as we use this module and would love to get a proper 6 release. But seeing as you've done a whole lot of work already, maybe you could share your current code or make a patch for 6-1 ?
#19
Can somebody give this back to me as a patch and I'd be happy to work on applying this to the D6 branch.
#20
Happy to do it - as long as designerbrent is not already half way there? ;)
#21
Go ahead Mark. I haven't had time to work on it yet.
#22
Ok, I have finished creating the patches, which combine the changes found in the .zip file in #11 with the branch 6-1--1.
Here are a list of the other changes I've made:
Note that the /po directory must be renamed to /translations for it to be fully Drupal 6 compatible.
I have tested in Firefox Mac, IE6, IE7 and it all looks good!
Cheers
Mark
#23
how much of a bandwidth hit is this??
swfobject is like 30kb right?
+1 subscribing
#24
Possible to get this tagged as a 6.x-2 dev release?
With emfield admin options pointing to this module, and with the recent emfield alpha3 release, creating a dev release for this module could have the added benefit of more testers.
#25
Revised patch. This is #22 rolled into a single file, patched against the DRUPAL-6--1 branch.
I also went ahead and did a ton of cleanup to the theme function. It now uses Drupal.settings in a clean fashion, so we're not writing bits and pieces of inline JS from PHP (which is painful). That clears up a bunch of issues with IE compatibility because we let Drupal build the JS for us. It also means that we're now properly checking for multiple uses, so we can place a flash image multiple times on a single page without things breaking. The JS has all been moved to the footer as well for better performance.
I also restored the "administer swfobject" permission. "administer site configuration" is a horrible horrible permission that flies in the face of configurability, and it should be exterminated with extreme prejudice from Drupal. :-)
Checked in Firefox 3, Safari 3, and IE 6, works fine in all of the above.
I need this for at least 2 of my modules, so let's get it in and tagged ASAP. :-)
#26
Thanks Crell, I wasn't sure about the permission because I couldn't decide whether it was intentionally removed (as it was absent from either the zip or the branch, can't remember).
The theme function definitely needed an overhaul. ;)
Cheers
Mark
#27
I'll get rolling on this later this week. I have a client deadline that I have to push through first.
#28
subscribing, looking at integrating this into video_filter
#29
Subscribing
#30
I merged these changes into DRUPAL-6--1-0-ALPHA1. Thanks to everybody who contributed to this- great to have so much support!
#31
Hooray! Thanks, Arthur!
Marking fixed since any future follow-up work should go in a different issue.
#32
Rock on!
#33
Automatically closed -- issue fixed for two weeks with no activity.