jQuery 1.3.x (Problem replacing modified version of tabledrag.js)
| Project: | jQuery Update |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
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.
| Attachment | Size |
|---|---|
| jquery_update_module_tabledrag.patch | 1.68 KB |

#1
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
Can't we go to that if we ever need to update drupal.js? For now we can enjoy our increased performance.
#3
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
I applied the patch and am still getting javascript errors when trying to drag and drop on views. Subscribing..
#5
I am also experiencing a similar problem when dragging items within Rearrange fields.
#6
subscribing
#7
subscribing
#8
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.
#9
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.
#10
#9 patch is working fine, many thanks.
The only thing is that you need to click second time to release.
#11
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
I think #9 is already in the latest dev.
Still need a full solution though.
#13
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
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
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