Modify

Opened 4 years ago

Last modified 3 years ago

#7377 reopened defect

Solve menu display conflict problem

Reported by: robin Owned by: robguttman
Priority: normal Component: DynamicFieldsPlugin
Severity: blocker Keywords:
Cc: robin, bjornar Trac Release: 0.11

Description

It seems that this plugin sometimes would affect the menus, there is something wrong with the javascript code on some pages. Here is my solution:
open the file ~/templates/dynfields.html and do the following changing:

var apply_rules = function(){
    var input = $(this);
    var triggers = get_triggers();
	   
    // execute the rule lifecycle...
       
    // setup each rule
    jQuery.each(triggers, function(trigger,specs){
        jQuery.each(specs, function(i,spec){
            try {
 	        spec.rule.setup(input, spec);
            }catch(e) {
            }
 	});
    });
 	   
    // apply each rule
    jQuery.each(triggers, function(trigger,specs){
        jQuery.each(specs, function(i,spec){
            if (input.attr('id') != specs.selector.slice(1))
                return;
            try {
                spec.rule.apply(input, spec);
            }catch(e){
            }
        });
    });
 	   
    // complete each rule
    jQuery.each(triggers, function(trigger,specs){
        jQuery.each(specs, function(i,spec){
            if (input.attr('id') != specs.selector.slice(1))
                return;
            try {
                spec.rule.complete(input, spec);
            }catch(e) {
            }
        });
    });
}

Attachments (0)

Change History (8)

comment:1 Changed 4 years ago by anonymous

Robin, thanks for this. Defensive programming is good but I don't want to mask the root problem. Instead I would prefer to understand and fix it.

Can you share more what exactly is and isn't working for you with this plugin - including any apparent side effects you're seeing? The more info (including trac.ini configs for this plugin) you can share the better. Thx.

comment:2 Changed 4 years ago by robguttman

Robin, please share what exactly is and isn't working for you with this plugin - including any apparent side effects you're seeing. Without more info I do not understand the problem and will need to close this ticket as invalid. Thanks.

comment:3 Changed 4 years ago by robguttman

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

Robin, you haven't responded so I'll assume you're no longer having this problem. If you are, please reopen this ticket. Thanks.

comment:4 follow-up: Changed 4 years ago by robin

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Hi Robguttman,

I'm so sorry that I missed this ticket. If I enable the plugin, it makes the MenusPlugin unable to work well. The main reason is that the javascript code on dynfields.html file would affect the superfish.js file which is the basic package for MenusPlugin.

Thanks,

Robin

comment:5 follow-up: Changed 3 years ago by bjornar

  • Severity changed from normal to blocker

This plugin breaks the Wyswig plugin, it removes that menu option, this makes me unable to use your plugin, aka. a blocker

comment:6 in reply to: ↑ 4 Changed 3 years ago by robguttman

  • Cc robin added; anonymous removed

Replying to robin:

Hi Robguttman,

I'm so sorry that I missed this ticket. If I enable the plugin, it makes the MenusPlugin unable to work well. The main reason is that the javascript code on dynfields.html file would affect the superfish.js file which is the basic package for MenusPlugin.

Thanks,

Robin

Robin, now it's my turn to apologize for the delayed response. I just tried and am unable to reproduce your problem using Trac 0.12.2 using Firefox 4.0.1. What versions are you using? If you're still having this problem (and still care), would you be able to send me the relevant parts of your trac.ini file?

comment:7 in reply to: ↑ 5 Changed 3 years ago by robguttman

  • Cc bjornar added

Replying to bjornar:

This plugin breaks the Wyswig plugin, it removes that menu option, this makes me unable to use your plugin, aka. a blocker

bjornar, I just tried and am unable to reproduce your problem using Trac 0.12.2 using Firefox 4.0.1. What versions are you using? What exact menu option are you talking about? Would you be able to send me the relevant parts of your trac.ini file?

comment:8 Changed 3 years ago by robguttman

Robin and bjornar, one reason why both may be having problems is that my plugin caused a javascript error before loading the javascript for the other plugins you're using. I've just fixed an issue that may have been the cause of the JS errors, so if interested please try this plugin again using the latest code.

If you still can't get it to work after that, please use your browser's developer tools (or Firebug on Firefox) to track down any javascript errors you see. If you do see one, please paste all of the details you can here including the full error, what web browser and version you're using, and ideally the portion of your trac.ini file that define your rules.

Lastly, be sure to use the 0.11 version of this plugin - not the 0.12 version!

Add Comment

Modify Ticket

Action
as reopened The owner will remain robguttman.
Author


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

 
Note: See TracTickets for help on using tickets.