Modify

Opened 4 years ago

Closed 3 years ago

#8553 closed defect (fixed)

Query page javascript errors

Reported by: bryankitts Owned by: robguttman
Priority: low Component: DynamicFieldsPlugin
Severity: minor Keywords:
Cc: trachacks@…, jbeilicke 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 4 years ago by bryankitts

  • Cc trachacks@… added

comment:2 Changed 3 years ago by jbeilicke

  • Cc jbeilicke 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 3 years ago by robguttman

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

comment:4 follow-up: Changed 3 years ago by 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.

comment:5 in reply to: ↑ 4 Changed 3 years ago by jbeilicke

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 3 years ago by robguttman

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

Great to hear! Closing.

Add Comment

Modify Ticket

Action
as 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.