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

duellj - July 15, 2008 - 22:03
Status:active» needs review

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

AttachmentSize
swfobject_api.6.x.patch 2.86 KB

#2

japanitrat - July 18, 2008 - 20:49

head seems completely b0rken.

#3

duellj - July 18, 2008 - 21:21

What do you mean? Does the patch not apply for the HEAD version? Or Is HEAD itself broken?

#4

japanitrat - July 19, 2008 - 16:14

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

arthurf - July 30, 2008 - 17:23

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

duellj - July 31, 2008 - 18:36

@arthurf

Here's my patch against the DRUPAL-5 branch.

Thanks,
Jon

AttachmentSize
swfobject_api.6.x.6.patch 2.56 KB

#7

arthurf - July 31, 2008 - 19:36

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

designerbrent - August 11, 2008 - 21:43

@arthurf: I Can't seem to find the DRUPAL-6--1 branch. Do you know where i can find it?

#9

arthurf - August 12, 2008 - 13:51

@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

designerbrent - August 12, 2008 - 16:16

@arthurf: thanks. Do you plan on creating a release?

#11

greenSkin - August 20, 2008 - 00:24

Here's a downloadible port to Drupal 6.

AttachmentSize
swfobject_api.zip 19.83 KB

#12

Rob Loach - August 20, 2008 - 01:00

Just a quick note that this module rocks....

#13

Mark Theunissen - September 26, 2008 - 09:51

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

Rob Loach - September 26, 2008 - 20:23
Version:5.x-2.0-beta1» 5.x-2.0-beta2
Status:needs review» needs work

It would be nice to have a patch from HEAD/DRUPAL-5--2 instead of just a zip ;-) .

#15

designerbrent - September 26, 2008 - 22:00

I think the zip is the same as the patch but i"m not sure.

#16

Mark Theunissen - September 29, 2008 - 09:47

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

designerbrent - September 29, 2008 - 14:55

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

Mark Theunissen - September 30, 2008 - 12:56

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

arthurf - September 30, 2008 - 13:11
Status:needs work» postponed (maintainer needs more info)

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

Mark Theunissen - September 30, 2008 - 15:59

Happy to do it - as long as designerbrent is not already half way there? ;)

#21

designerbrent - September 30, 2008 - 17:30

Go ahead Mark. I haven't had time to work on it yet.

#22

Mark Theunissen - October 1, 2008 - 14:35
Assigned to:Anonymous» Mark Theunissen
Status:postponed (maintainer needs more info)» needs review

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:

  • Added more info to the .info file, changed the name from SWFObject Module to SWFObject API
  • Bumped the version to 6.x-2.0 because it uses the swfobject 2.1 library
  • Rewrote the install file, so now it uses hook_requirements() to check that swfobject.js has been correctly installed
  • It will now also report an error in the site's status report if the file isn't copied correctly
  • Fixed bug that I mentioned above, where it wouldn't work in IE
  • Removed the permission "administer swfobject", now a user simply requires "administer site configuration"
  • Fixed numerous errors and suggestions thrown up by Coder.module review
  • Added a hook_uninstall() to delete variables
  • Changed external links to point to Google Code repository instead of the blog with version 1.5
  • Fixed up the README.txt file

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

AttachmentSize
README.txt.patch 2.75 KB
swfobject_api.info_.patch 574 bytes
swfobject_api.install.patch 2.62 KB
swfobject_api.module.patch 9.92 KB

#23

chasz - October 10, 2008 - 10:22

how much of a bandwidth hit is this??

swfobject is like 30kb right?

+1 subscribing

#24

bonobo - October 11, 2008 - 14:07

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

Crell - October 13, 2008 - 21:29
Priority:normal» critical

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. :-)

AttachmentSize
swfobject6.patch 17.09 KB

#26

Mark Theunissen - October 14, 2008 - 08:55

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

arthurf - October 14, 2008 - 14:32

I'll get rolling on this later this week. I have a client deadline that I have to push through first.

#28

trophaeum - October 26, 2008 - 07:43

subscribing, looking at integrating this into video_filter

#29

greys - October 28, 2008 - 18:36

Subscribing

#30

arthurf - October 29, 2008 - 02:42

I merged these changes into DRUPAL-6--1-0-ALPHA1. Thanks to everybody who contributed to this- great to have so much support!

#31

Crell - October 29, 2008 - 04:52
Version:5.x-2.0-beta2» 6.x-1.0-alpha1
Status:needs review» fixed

Hooray! Thanks, Arthur!

Marking fixed since any future follow-up work should go in a different issue.

#32

Rob Loach - October 29, 2008 - 07:20

Rock on!

#33

Anonymous (not verified) - November 12, 2008 - 07:33
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.