Opened 12 years ago
Last modified 12 years ago
#9659 closed defect
ResourceNotFound error when updating grid on ActiveTickets screen — at Version 3
Reported by: | C. G. Brown | Owned by: | Björn Harrtell |
---|---|---|---|
Priority: | normal | Component: | GridModifyPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description (last modified by )
Trac 0.11.7 GridModify 0.1.3 and 0.1.5 Firefox 8.0.1 and Chrome 16.0.912.63
I take the following steps as a TRAC_ADMIN with the GridModify plugin enabled:
- Go to the View Tickets link
- Go to the Active Tickets Screen
- Attempt to update component
I get a red X back. When I run this in Firebug, I get a 500 error against a URL of the form:
When I run the update link that is fired off as an AJAX call in my web browser, I get the message:
Oops... Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/GridModify-0.1.3-py2.5.egg/gridmod/web_ui.py", line 56, in process_request ticket = Ticket(self.env, id) File "/usr/local/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/model.py", line 50, in __init__ self._fetch_ticket(tkt_id, db) File "/usr/local/lib/python2.5/site-packages/Trac-0.11.7-py2.5.egg/trac/ticket/model.py", line 102, in _fetch_ticket 'Invalid Ticket Number') ResourceNotFound: Ticket 323456789101112131415 does not exist.
It appears to be merging the ticket numbers from the entire grid. It renders the plugin unusable, unfortunately.
I'm going to take a look at the CSS selection that the JS is doing and see if I can propose a patch. Is there anything I'm doing wrong or should be considering when evaluating the issue here?
Change History (4)
comment:1 Changed 12 years ago by
Owner: | changed from Björn Harrtell to C. G. Brown |
---|---|
Status: | new → assigned |
Changed 12 years ago by
Attachment: | grid_modify_plugin_jquery_parent_patch.diff added |
---|
comment:2 Changed 12 years ago by
Owner: | changed from C. G. Brown to Björn Harrtell |
---|---|
Status: | assigned → new |
I've attached a proposed fix. Inspection in Firebug and Web Inspector showed me that on line 75 of the gridmod.js file, $(this).parents('tr') was returning all of the parents. The text was being concatenated, which produced the problem. I replaced that with $(this).parent('td').parent('tr'), which calls the ancestor directly above the line in question and no others. This seemed to fix the problem on our servers.
This would have been a showstopper if it happened for everyone, so the most likely cause is a difference or change in jQuery semantics, depending on what version of jQuery you're running. It's possible that in some versions .parents() returns the first ancestor that fits instead of all of them. Our Trac appears to be running jQuery 1.2.6.
At any rate, the fix above should work in both cases. I'll reassign to the project owner for review and committing at his leisure.
comment:3 Changed 12 years ago by
Description: | modified (diff) |
---|
Patch to make it choose one tr parent instead of all of them.