Modify

Opened 22 months ago

Closed 22 months ago

Last modified 22 months 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: rjollos 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 22 months ago.
error.PNG (23.2 KB) - added by thomasd 22 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 22 months ago by falkb

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

comment:2 follow-ups: Changed 22 months ago by rjollos

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 22 months ago by rjollos

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 22 months ago by rjollos

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 22 months 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 22 months ago by rjollos

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

comment:7 Changed 22 months 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 22 months ago by thomasd

Changed 22 months ago by thomasd

comment:8 Changed 22 months ago by thomasd

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

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 22 months ago by thomasd

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

Sorry ;-)

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from thomasd. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.