Modify

Opened 6 years ago

Closed 6 years ago

#8553 closed defect (fixed)

Query page javascript errors

Reported by: Bryan Kitts Owned by: Rob Guttman
Priority: low Component: DynamicFieldsPlugin
Severity: minor Keywords:
Cc: trachacks@…, Jan Beilicke Trac Release: 0.11

Description

DynamicFieldsPlugin seems to throw an error on Trac query page for my configuration (Trac 0.11.5, tracd, multiple Trac databases on same server, Firefox 3.6 and IE7).

The only obvious effect of this is that the Filters and Columns sections of the Trac Query page are no longer collapsible. Not sure if it causes any other problems.

The cause seems to be in dynfields.html. When I navigate to the Query page http://dblonws29921.uk.db.com/MVProjects/query window.location.pathname is actually set to '/MVProjects/query' so the code chooses the wrong branch.

Adding the substr() below fixes it for me. Not sure if there's a neater solution.

jQuery(document).ready(function($){
    var triggers = get_triggers(); // trigger fields
    
   if (window.location.pathname.substr(window.location.pathname.length-6,6) == '/query'){

[Hope that makes sense --Bryan]

Attachments (0)

Change History (6)

comment:1 Changed 6 years ago by Bryan Kitts

Cc: trachacks@… added; anonymous removed

comment:2 Changed 6 years ago by Jan Beilicke

Cc: Jan Beilicke added

I had a similar issue with Trac 0.12 and plugin branch 0.11. I fixed it with:

$ svn diff ./dynfields/templates/dynfields.html 
Index: dynfields/templates/dynfields.html
===================================================================
--- dynfields/templates/dynfields.html  (revision 9938)
+++ dynfields/templates/dynfields.html  (working copy)
@@ -70,7 +70,7 @@
 jQuery(document).ready(function($){
     var triggers = get_triggers(); // trigger fields
     
-       if (window.location.pathname == '/query'){
+       if (window.location.pathname.indexOf('/query')){
         // hide all "hide_always" fields
         jQuery.each(triggers, function(trigger,specs){
                        jQuery.each(specs, function(i,spec){

comment:3 Changed 6 years ago by Rob Guttman

(In [9939]) refs #8553: fixed two JS errors.

comment:4 Changed 6 years ago by Rob Guttman

Thanks for reporting this and the suggested fixes. I just fixed this and another JS error in the plugin on the 0.11 branch only. Please let me know if it now works for you or not. Thanks.

comment:5 in reply to:  4 Changed 6 years ago by Jan Beilicke

Replying to robguttman:

Thanks for reporting this and the suggested fixes. I just fixed this and another JS error in the plugin on the 0.11 branch only. Please let me know if it now works for you or not. Thanks.

Works fine (for me), thanks for the quick patch!

BTW: The other fixed error regarding the id was causing my problem. It worked with the patch I mentioned above, so I didn't get into detail regarding the underlying issue when adding my comment. Sorry for that.

comment:6 Changed 6 years ago by Rob Guttman

Resolution: fixed
Status: newclosed

Great to hear! Closing.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Rob Guttman.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.