jQuery 1.3.x (Problem replacing modified version of tabledrag.js)

jcmarco - May 3, 2009 - 18:14
Project:jQuery Update
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

The jquery_update is not replacing the core tabledrag.js with the new one fixed in #350275: Update to jQuery 1.3.2 and really well added to jquery_update in replace/.

In the $scripts variable the tabledrag.js is not considered core, is considered module but in the jquery_update_get_replacements is defined as core.

Changing this wrong classifications, do everything work great.

So if there is not two types of scripts to search and replace, then we can simplify and increase preformance with the replacement loop in jquery_update_preprocess_page and replace only module types scripts
(simplifying as well the jquery_update_get_replacements() function)

That patch fixes #366250: jQuery 1.3.x and Views UI, and now it is working great with views 2.0, and any other tested/fixed module ( http://drupal.org/node/358082#comment-1493246 )
and I think that this views 2.0 issue was the last one to avoid a new release of this so good module.

AttachmentSize
jquery_update_module_tabledrag.patch1.68 KB

#1

markus_petrux - May 3, 2009 - 18:38

If jquery_update needs to update 'misc/drupal.js' in the future, then this simplification will not work.

Maybe it would be enough moving the entry for 'misc/tabledrag.js' from the 'core' array to 'module' in jquery_update_get_replacements() ?

#2

Flying Drupalist - May 4, 2009 - 19:08

Can't we go to that if we ever need to update drupal.js? For now we can enjoy our increased performance.

#3

markus_petrux - May 4, 2009 - 19:24

It is an option indeed, but it may break other modules that rely on the current structure of the data returned by jquery_update_get_replacements().

For example, a few weeks ago I started to co-maintain the Ajax Load module, and there was an issue that I was only able to fix by using the same proprocess as jquery_update. Reference: #389148: Tracking loaded javascripts and support for jquery_update

The problem was, and it could happen under other similar use cases, that jquery_update does its job when theme('page') is processed, but if you're using AHAH that needs to dynamically load scripts/stylesheets, you need to do all the stuff by yourself.

So I would prefer to keep the current structure if possible.

#4

koshea - May 13, 2009 - 23:42
Status:needs review» needs work

I applied the patch and am still getting javascript errors when trying to drag and drop on views. Subscribing..

#5

jeff00seattle - May 19, 2009 - 20:34

I am also experiencing a similar problem when dragging items within Rearrange fields.

#6

attheshow - May 19, 2009 - 21:28

subscribing

#7

darrindickey - May 22, 2009 - 15:56

subscribing

#8

jcmarco - July 6, 2009 - 08:13
Title:jQuery 1.3.x and Views UI. (Problem replacing modified version of tabledrag.js)» jQuery 1.3.x (Problem replacing modified version of tabledrag.js)
Status:needs work» needs review

I was checking the jquery_update issue list, and I found that I mistakenly I forgot to upload a new patch with @markus_petrux comments at #5.
I realized that it was a change out of the scope of this issue, and this kind of changes probably needed a new release.

Here is the patch with just the classification fix.
Anyway this patch didn't solve the issues with the new tabledrag.js in some modules, but solved the error with the new tabledrag.js insertion.

AttachmentSize
jquery_update.module_tabledrag_2.patch 451 bytes

#9

CPyle - July 16, 2009 - 21:23

I noticed that applying the patch in #8 results in slightly better behavior in modules (ie. Views) but breaks tabledrag in core.

Leaving the tabledrag entry in both the 'core' and 'module' arrays makes it behave correctly in both.

Views 2 rearranging of items still behaves wonkily, in that the row will stick to the cursor after you release your mouse button, but clicking once usually fixes it. I'm pretty sure this issue is still in the Views queue.

AttachmentSize
jquery_update.module_tabledrag_3.patch 451 bytes

#10

kenorb - September 9, 2009 - 15:03
Status:needs review» reviewed & tested by the community

#9 patch is working fine, many thanks.
The only thing is that you need to click second time to release.

#11

kmonty - September 13, 2009 - 21:22

Patch #9 is working well for me, although I am still having issues with having to click to release in views. Not perfect, but definitely a significant improvement.

#12

Flying Drupalist - September 13, 2009 - 21:54

I think #9 is already in the latest dev.

Still need a full solution though.

#13

markus_petrux - September 14, 2009 - 00:03

The patch in #9 works for me.

Also, I have re-opened the Views issue because the problem with "I am still having issues with having to click to release in views" lives in Views. Please, check the fix and explanation posted here: #366250: jQuery 1.3.x and Views UI

#14

jcmarco - September 14, 2009 - 07:15

With last solution in #366250: jQuery 1.3.x and Views UI by @markus_petrux, where he fixed the existing issue with views (in my jquery_update pending issue list that was the last pending one, http://drupal.org/node/358082#comment-1493246) we are really close to end with the jQuery migration to 1.3.2 in D6.
In any case, with @markus_petrux solution, I found that both patches, #8 and #9 work fine with the views issue. But probably only adding the tabledrag.js to one of the categories should be enough.

#15

jcmarco - September 15, 2009 - 16:46

There are still issues dragging in lists, as in blocks admin or filefield cck form elements with patch #8
but with patch #9 with tabledrag.js in module and core both cases work fine and with markus_petrux fix for views works fine as well.
(tested with IE7 and Firefox)

So patch #9 is working

 
 

Drupal is a registered trademark of Dries Buytaert.