Opened 7 years ago

Closed 4 years ago

#6442 closed defect (wontfix)

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

Reported by: Vincent Owned by: coderanger
Priority: normal Component: TicketDeletePlugin
Severity: major Keywords:
Cc: Carsten Trac Release: 0.11



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 7 years ago by Carsten

  • Cc Carsten added; anonymous removed

Same here.

comment:2 Changed 7 years ago by jun66j5

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

  • ticketdelete/htdocs/ticketdelete.js

    11$(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];
    37    var delete_link = '<a href="../admin/ticket/delete/'+ticket+'">Delete</a>';
    48    var ticket_buttons = $('#ticket .inlinebuttons')[0];
    59    if (ticket_buttons) {

comment:3 Changed 7 years ago 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

comment:4 Changed 4 years ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

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

Add Comment

Modify Ticket

as closed The owner will remain coderanger.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.