Multiple Javascript Versions for Contrib Modules

mfer - August 19, 2008 - 22:40
Project:jQuery Update
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed
Description

Imagine the situation where a contrib module writes it's JavaScript for drupal 6 core at jQuery 1.2.6 but, jQuery Update is now on version 1.3 and that contrib module and jQuery Update won't work side by side. This ended up being a common problem in my drupal 5 experience.

What if jQuery Update provides either:

1) A way for modules to plug into the replacement process so they can add files that need to be replaced.

2) Provide a function (or maybe just variable_get('jquery_update_replace', TRUE)) to see if they should have the jQuery Update or Core js version supplied.

3) Provide documentation on how to handle the updating jQuery versions provided by jQuery Update.

I'm a fan of 1 or 2 along with 3. I'm not sure which would be better. If we want modules to be able to substitute updated js for other modules we would need 1. If we expect modules to handle which version themselves 2 might be fine.

In any case I'd like to see this one get nipped in the bud before incompatibility creeps into drupal 6 which will have a long than previous version shelf life.

Thoughts?

#1

mfer - December 16, 2008 - 00:08
Status:active» postponed

#2

vood002 - December 29, 2009 - 19:37

I've run into the need for some functionality along these lines.

It seems to me that allowing admins to set paths that will/won't use the updated version of JQuery would be an easy way to go about this, albeit perhaps not the best way.

I have an IE7 issue with views tabs that requires Jquery 1.3x, but several modules like Advanced Poll and NodeReference Explorer break when not using core 1.2.6.

At the moment I've written a simple hack into function jquery_update_preprocess_page() that checks the arguments: if( arg(0) == 'training' ): and only changes from the core if necessary.

#3

mfer - December 30, 2009 - 14:58

@vood002 This is a very complicated problem. Many features in drupal cross different pages of the site. What if views tabs is being used on a page with something that requires jQuery 1.2.x? Do you put both on the same page? In D6 you can't do this because it will break.

Choosing by path is something only advanced developers who really test sites before pushing them live (even with updates) should attempt. A better way is to file issues against modules like Advanced Poll and NodeReference Explorer. Most likely they are using deprecated jQuery features that 1.2.x still supported.

 
 

Drupal is a registered trademark of Dries Buytaert.