Opened 10 years ago

Closed 10 years ago

Conflict with timingandestimation plugin

Reported by: Owned by: raa Jeff Hammel normal AutoQueryPlugin critical 0.11

Description

I have got some custom fields produced by timingandestimation plugin. And it seems that AutoQuery breaks those fields. It is probably because timingandestimation do not expect html code in own field values. Pelase see the attached screenshot.

comment:1 Changed 10 years ago by Jeff Hammel

i'll install timing and estimation when i can (probably tomorrow) and see if I can reproduce; what should be displayed in the NaNh fields? (some number, i assume?)

comment:2 Changed 10 years ago by Jeff Hammel

Status: new → assigned

comment:3 Changed 10 years ago by anonymous

Thanks. There should be hours. 1h, 16h, etc. So the "h" character is still there. However the numbers are replaced with "NaN".

comment:4 Changed 10 years ago by Jeff Hammel

The issue here is the JS. the TimingAndEstimationPlugin loads JS that tries to markup the field and so when it finds the link instead of a number it "blows up" (prints NaNh). So this can't really be "fixed" in any meaningful way. Disabling JS and loading a ticket page displays the correct results ( http://localhost:14828/barproj/query?estimatedhours=5&order=priority , which functions correctly ).

I will enable a workaround, which is to limit the fields that the AutoQueryPlugin acts on, so that these fields can be marked not to display the link. Any better ideas on how to have these fields AutoQuery-able and function with TimingAndEstimationPlugin would be welcome.

As a complete aside, this is a disadvantage of component architecture as implemented in trac and most everywhere else it is used. The plugins have a contract with the master program, so each plugin should work with it correctly. But plugins have no contract with other plugins so conflicts can arise when two plugins are installed. As an example, AutoQueryPlugin will not work with anything that tests filename == 'ticket.html', e.g. the TicketSubmitPolicyPlugin. This is an oversight and an example of bad plugin design; the would-be fix is documented in http://trac-hacks.org/ticket/3161 . I don't have a cheap fix for this general problem, except to try to design plugins that play nice with one another.

comment:5 follow-up:  6 Changed 10 years ago by Jeff Hammel

Resolution: → fixed assigned → closed

(In [3836]) add excluded_fields to not be marked up by AutoQuery; fixes #3178

comment:6 in reply to:  5 Changed 10 years ago by raa

Thank you very much for the workaround and for the great work.

comment:7 Changed 10 years ago by Jeff Hammel

Thank you for the feedback! If you come up with a better solution to this problem, please let me know.

comment:8 Changed 10 years ago by raa

I'm not an expert in Python and Trac, so I think your solution is always better of mine :-) Actually I think the current solution with excluded fields is good. It is exactly what I'd like to have.