Ticket #10106 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

plugin doesn't work correctly on click on ticket link

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

error_console.jpg (94.5 kB) - added by thomasd on 06/20/12 04:38:52.
error.PNG (23.2 kB) - added by thomasd on 06/20/12 04:39:20.

Change History

06/19/12 22:35:35 changed by falkb

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

(follow-ups: ↓ 4 ↓ 5 ) 06/19/12 22:42:55 changed 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.

06/19/12 22:44:23 changed 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.

(in reply to: ↑ 2 ) 06/19/12 23:08:46 changed 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.

(in reply to: ↑ 2 ) 06/19/12 23:57:52 changed 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

06/20/12 03:57:58 changed by rjollos

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

06/20/12 04:38:21 changed 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.

06/20/12 04:38:52 changed by thomasd

  • attachment error_console.jpg added.

06/20/12 04:39:20 changed by thomasd

  • attachment error.PNG added.

06/20/12 05:45:48 changed by thomasd

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

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.

06/20/12 05:47:00 changed by thomasd

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

Sorry ;-)


Add/Change #10106 (plugin doesn't work correctly on click on ticket link)




Change Properties
Action