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 Carsten

Cc: Carsten added; anonymous removed

Same here.

comment:2 Changed 15 years ago by Jun Omae

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 15 years ago by Ryan J Ollos

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 Ryan J Ollos

Resolution: wontfix
Status: newclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.