#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)
Change History (11)
comment:1 Changed 12 years ago by
comment:2 follow-ups: 4 5 Changed 12 years ago by
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
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 Changed 12 years ago by
comment:5 Changed 12 years ago by
Replying to rjollos:
You might try placing it in a
js
subdirectory - changing the path togroupticketfields/js/group_ticket_fields.js
Tried it but that didn't help
comment:6 Changed 12 years ago by
I haven't been able to reproduce. Any chance you are seeing a conflict with another plugin?
comment:7 Changed 12 years ago by
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
Attachment: | error_console.jpg added |
---|
Changed 12 years ago by
comment:8 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → 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 12 years ago by
Ok, the last line should have been: Resolved with [11664].
Sorry ;-)
jQuery(document).ready(function($) is not called when clicking on the link, but on page reload.