Ticket #6442 (closed defect: wontfix)

Opened 3 years ago

Last modified 10 months ago

[Patch] javascript error: /\/ticket\/(\d+)/.exec(document.location) is null

Reported by: Vincent Assigned to: coderanger
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

Change History

01/22/10 21:38:29 changed by Carsten

  • cc set to Carsten.

Same here.

01/25/10 05:06:05 changed by jun66j5

I have got a same problem. In my environment, I applied the following patch that works in the /newticket page.

Index: ticketdelete/htdocs/ticketdelete.js
===================================================================
--- ticketdelete/htdocs/ticketdelete.js (revision 7469)
+++ ticketdelete/htdocs/ticketdelete.js (working copy)
@@ -1,5 +1,9 @@
 $(document).ready(function() {
-    var ticket = /\/ticket\/(\d+)/.exec(document.location)[1];
+    var matched = /\/ticket\/(\d+)/.exec(document.location);
+    if (!matched) {
+        return;
+    }
+    var ticket = matched[1];
     var delete_link = '<a href="../admin/ticket/delete/'+ticket+'">Delete</a>';
     var ticket_buttons = $('#ticket .inlinebuttons')[0];
     if (ticket_buttons) {

05/04/10 00:00:43 changed by rjollos

  • summary changed from javascript error: /\/ticket\/(\d+)/.exec(document.location) is null to [Patch] javascript error: /\/ticket\/(\d+)/.exec(document.location) is null.

07/27/12 03:01:19 changed by rjollos

  • status changed from new to closed.
  • resolution set to wontfix.

The JavaScript is being removed in #1749, which will most likely resolve this issue.


Add/Change #6442 ([Patch] javascript error: /\/ticket\/(\d+)/.exec(document.location) is null)




Change Properties
Action