Project

General

Profile

Actions

Defect #5699

closed

Prototype 1.6.1 breaks the "check all" links

Added by R Daneel Olivaw almost 14 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
UI
Target version:
-
Start date:
2010-06-16
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

In my redmine setup all the "check all" boxes do nothing.

From debian packages :
  1. your database version (eg. Postgresql 8.2)
    postgresql 8.3.11-0lenny1
  2. your Ruby version (eg. ruby 1.8.6)
    ruby 4.2
  3. your Rails version (eg. Rails 1.2.6)
    2.2.3-2~bpo50+1
  4. 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
Actions #1

Updated by Eric Davis almost 14 years ago

  • Subject changed from The "check all" boxes to The "check all" boxes do nothing
Actions #2

Updated by Nick Peelman almost 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?

Actions #3

Updated by R Daneel Olivaw almost 14 years ago

my installed prototype is also 1.6.1 from Debian package.

Actions #4

Updated by Jean-Baptiste Barth almost 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 ?

Actions #5

Updated by Nick Peelman almost 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?

Actions #6

Updated by Felix Schäfer almost 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?

Actions #7

Updated by Felix Schäfer almost 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
Actions #8

Updated by Nick Peelman almost 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?

Actions #9

Updated by Etienne Massip over 12 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed
Closing this issue since:
Actions

Also available in: Atom PDF