Posted by JacobSingh on May 17, 2010 at 11:16am
14 followers
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | base system |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
This is not showing up in core as an error, but if the Array prototype has been added to, this will cause the iterating code to run over properties (and methods) of the Array, as opposed to just the elements. It's bad form in JavaScript to use the for...in construct when working with arrays (should only be used for objects).
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| tabledrag_iterator.patch | 3.44 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 20,340 pass(es). | View details |
Comments
#1
Oops, snuck some extra changes in there.
#2
A simpler fix is just to construct the for loop correctly.
#3
Guess I should retitle the issue, too.
#4
Yep. Better Javascript!
#5
Committed to CVS HEAD. Thanks.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.
#7
Could this please be back ported to the 6.x branch. Patch attached.
Many thanks!
#8
subscribe
#9
+1 for backport to D6
#10
Re-posting patch from #7. No credit please!
#11
Super, perfect fix for my ageing Drupal 6 site.
At present its preventing admin forms from working in Chrome so a bit more than a 'minor' issue I think.
The bug is also not just in the block.module - it also affects the taxonomy admin, webform field designer, CCK field editor etc.
#12
Looks good. Thanks, committed, pushed.
#13
Automatically closed -- issue fixed for 2 weeks with no activity.
#14
I usually check the patches before I update my Drupal and I ran across this issue and fix.
I would recommend taking it one step further and look at reducing the number of gratuitous .length calls with the hopes of improving the speed of tabledrag.js further. From my simple test (profiling patch included in issue), it could reduce the number of calls to .length from ~30,000+ to roughly 450 for a single drag.
Take a look
#1571814: tableDrag.js, reduce the number of calls of .length from 33478 to 455