Modify ↓
Opened 15 years ago
Closed 12 years ago
#6442 closed defect (wontfix)
[Patch] javascript error: /\/ticket\/(\d+)/.exec(document.location) is null
Reported by: | Vincent | Owned by: | Noah Kantrowitz |
---|---|---|---|
Priority: | normal | Component: | TicketDeletePlugin |
Severity: | major | Keywords: | |
Cc: | Carsten | Trac Release: | 0.11 |
Description
Hello,
Using TicketDeletePlugin 2.0 with Trac 0.11 with Python 2.4.
It works great but on the page "newticket" of Trac, a javascript error occurs due to TicketDeletePlugin:
Error: /\/ticket\/(\d+)/.exec(document.location) is null Source File: https://www.myserver.tld/myproject/chrome/ticketdelete/ticketdelete.js Line: 2
Thats's annoying because it breaks the other javascript running on this page (in particular the ajax stuff of AutocompleteUsersPlugin).
Attachments (0)
Change History (4)
comment:1 Changed 15 years ago by
Cc: | Carsten added; anonymous removed |
---|
comment:2 Changed 15 years ago by
I have got a same problem.
In my environment, I applied the following patch that works in the /newticket
page.
-
ticketdelete/htdocs/ticketdelete.js
1 1 $(document).ready(function() { 2 var ticket = /\/ticket\/(\d+)/.exec(document.location)[1]; 2 var matched = /\/ticket\/(\d+)/.exec(document.location); 3 if (!matched) { 4 return; 5 } 6 var ticket = matched[1]; 3 7 var delete_link = '<a href="../admin/ticket/delete/'+ticket+'">Delete</a>'; 4 8 var ticket_buttons = $('#ticket .inlinebuttons')[0]; 5 9 if (ticket_buttons) {
comment:3 Changed 15 years ago by
Summary: | javascript error: /\/ticket\/(\d+)/.exec(document.location) is null → [Patch] javascript error: /\/ticket\/(\d+)/.exec(document.location) is null |
---|
comment:4 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The JavaScript is being removed in #1749, which will most likely resolve this issue.
Note: See
TracTickets for help on using
tickets.
Same here.