Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10106 closed defect (fixed)

plugin doesn't work correctly on click on ticket link

Reported by: falkb Owned by: thomasd
Priority: high Component: GroupTicketFieldsPlugin
Severity: major Keywords:
Cc: Ryan J Ollos Trac Release: 0.11

Description

Just click on a ticket link like #123 and see how the plugin doesn't work. On page reload it suddenly works well

Attachments (2)

error_console.jpg (94.5 KB) - added by thomasd 12 years ago.
error.PNG (23.2 KB) - added by thomasd 12 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 years ago by falkb

jQuery(document).ready(function($) is not called when clicking on the link, but on page reload.

comment:2 Changed 12 years ago by Ryan J Ollos

You might try placing it in a js subdirectory - changing the path to groupticketfields/js/group_ticket_fields.js. Just a guess here, but I ran into some issues previously with resources not being correctly classified if they weren't in the desired directory structure.

comment:3 Changed 12 years ago by Ryan J Ollos

I think the use of jQuery(document).read(function($) ... is correct though. Here's an example from a well-regarded plugin: batchmodifyplugin/0.12/trunk/batchmod/htdocs/js/batchmod.js.

comment:4 in reply to:  2 Changed 12 years ago by Ryan J Ollos

Replying to rjollos:

Just a guess here, but I ran into some issues previously with resources not being correctly classified if they weren't in the desired directory structure.

The issue I was thinking of is #7617.

comment:5 in reply to:  2 Changed 12 years ago by falkb

Replying to rjollos:

You might try placing it in a js subdirectory - changing the path to groupticketfields/js/group_ticket_fields.js

Tried it but that didn't help

comment:6 Changed 12 years ago by Ryan J Ollos

I haven't been able to reproduce. Any chance you are seeing a conflict with another plugin?

comment:7 Changed 12 years ago by thomasd

Well, I can reproduce it. BUT, only when I click on a ticket via roadmap. Via "view ticket" everything works fine ?!?!

The problem seems to be a bug in another module? I get a javascript script error in search.js. And that seems to stop the javascript interpreter. There are other jQuery.ready calls (from other plugins and trac itself) that aren't called, too. E.g. the "Modify Ticket" is usually foldable. In our "not working" case, it is not.

Changed 12 years ago by thomasd

Attachment: error_console.jpg added

Changed 12 years ago by thomasd

Attachment: error.PNG added

comment:8 Changed 12 years ago by thomasd

Resolution: fixed
Status: newclosed

Well, thats interesting.

I firebuged a bit and found the reason for the search.js error: Another plugin we are currently "maintaining" (SimpleMultiProjectPlugin) defines a javascript Array.prototype function "has".

search.js/getSearchTerms has a for statement for (var p in params). However, since the above defined prototype functions is assumed to be in params the following statement params[p].split fails for p == "has".

I haven't realized yet, that iterating over elements in an array includes prototype function names.

Resolved with #11664.

comment:9 Changed 12 years ago by thomasd

Ok, the last line should have been: Resolved with [11664].

Sorry ;-)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain thomasd.
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.