Defect #5699
closedPrototype 1.6.1 breaks the "check all" links
0%
Description
In my redmine setup all the "check all" boxes do nothing.
From debian packages :- your database version (eg. Postgresql 8.2)
postgresql 8.3.11-0lenny1 - your Ruby version (eg. ruby 1.8.6)
ruby 4.2 - your Rails version (eg. Rails 1.2.6)
2.2.3-2~bpo50+1 - your Redmine version (pick the version number in the Affected version field) and the exact revision (eg. r1142) if you're using repository code
0.9.4-2~bpo50+1
Updated by Eric Davis over 14 years ago
- Subject changed from The "check all" boxes to The "check all" boxes do nothing
Updated by Nick Peelman over 14 years ago
I’m seeing this as well. The error Safari’s inspector shows me is in Prototype, line 3299:
TypeError: Result of expression 'root.querySelectorAll' [undefined] is not a function.
Somehow my version of 0.9.4 installed Prototype 1.6.1. Rolling back to 1.6.03 (which is what is in in the trunk) causes them to work again. Perhaps this has already been fixed?
Updated by R Daneel Olivaw over 14 years ago
my installed prototype is also 1.6.1 from Debian package.
Updated by Jean-Baptiste Barth over 14 years ago
So it's a Debian packaging problem if I understand. If so, maybe you could open a ticket on their bug tracking system and we can close this one ?
Updated by Nick Peelman over 14 years ago
I would say the problem lies more with Prototype than with Debian including the latest version, if a bug was to go anywhere, why wouldn’t it go there?
Updated by Felix Schäfer over 14 years ago
- Category changed from Administration to UI
It is a problem with debian because they take out the packaged prototype and put in their own. If they want to do it, they should at least stick to the same version.
Anyway, I'd say this is confirmed though none of our direct business, though we need to be aware of it for when we update the bundled prototype. Can anyone js-savvy see if prototype is at fault, if how redmine uses it is to blame or if it's a browser-specific thing?
Updated by Felix Schäfer over 14 years ago
- Subject changed from The "check all" boxes do nothing to Prototype 1.6.1 breaks the "check all" links
- Priority changed from Normal to Low
Updated by Nick Peelman over 14 years ago
That was kind of my point. Things shouldn’t break across versions like this, at least not in the way that it is breaking. There’s no point in blaming Debian for packaging it when Redmine will probably want to upgrade eventually anyway. That being said, it doesn’t appear to be browser specific (I tested Safari, Firefox mac, Firefox PC, and IE, all did the same thing), and it appears to be a naming scheme that breaks it.
The code in question from 1.6.0.3
findElements: function(root) { root = root || document; var e = this.expression, results; switch (this.mode) { case 'selectorsAPI': // querySelectorAll queries document-wide, then filters to descendants // of the context element. That's not what we want. // Add an explicit context to the selector if necessary. if (root !== document) { var oldId = root.id, id = $(root).identify(); e = "#" + id + " " + e; } results = $A(root.querySelectorAll(e)).map(Element.extend); root.id = oldId; return results; case 'xpath': return document._getElementsByXPath(this.xpath, root); default: return this.matcher(root); } },
From 1.6.1:
findElements: function(root) { root = root || document; var e = this.expression, results; switch (this.mode) { case 'selectorsAPI': if (root !== document) { var oldId = root.id, id = $(root).identify(); id = id.replace(/([\.:])/g, "\\$1"); e = "#" + id + " " + e; } results = $A(root.querySelectorAll(e)).map(Element.extend); root.id = oldId; return results; case 'xpath': return document._getElementsByXPath(this.xpath, root); default: return this.matcher(root); } },
By my diff the only code difference is:
id = id.replace(/([\.:])/g, "\\$1”);
Essentially they’re now escaping any periods or colons with a backslash. How this causes the problem I am not sure, as I didn’t dive into the Ruby deep enough to figure out the specifics, but maybe this leg work will make it quicker for somebody more familiar with the guts to recognize and patch?
Updated by Etienne Massip about 13 years ago
- Status changed from New to Closed
- Resolution set to Fixed
- Redmine use Prototype 1.7 since of 1.1.3 (see #7954)
- Prototype 1.7 has replaced selector code, including buggy one, by the use of Sizzle (see https://github.com/sstephenson/prototype/commit/4dd878f237e79db11a6532e3f74059c9b908069c#src/dom/selector.js)