Opened 6 years ago

Closed 13 months ago

# Plugin seems to interfere with custom field ordering

Reported by: Owned by: Chris Nelson Russ Tyndall high TimingAndEstimationPlugin normal

### Description

I'm using TimingAndEstimationPlugin with MasterTickets, Subtickets, and EstimationTools plugins and I'm seeing strange behavior with regard to how custom fields are displayed.

A ticket type with no custom fields has 8 standard fields at the top:

 Reporter Owner Priority Milestone Component Version CC Keywords

My custom fields are ordered:

 field order estimatedhours 0 confidence 1 blockedby 2 blocking 3 build 4 hours 5 totalhours 6 customer 7 defectcause 8 supplier_name 9 supplier_id 10 supplier_pn 11 supplier_contact 12 userfinish 13 parents 14

If I add in estimatedhours, a locally-defined field (confidence), and blockedby, and blocking, they are after Keywords:

 Reporter Owner Priority Milestone Component Version CC Keywords Estimated Hours Confidence Depends On Required For

 Reporter Owner Priority Milestone Component Version CC

then a few fields continue being added after hours, before keywords then the addition resumes at the end of the custom fields. I eventually end up with:

 Reporter Owner Priority Milestone Component Version CC Build empty Total Hours Keywords Estimated Hours Confidence Depends On Required For Due Date Parent Ticket

I'm using 0.8.8 but I've diff'd against 1.2.7 and can't see anything related to the field positioning.

Any thoughts on resolving this would be welcome.

### comment:1 Changed 6 years ago by Chris Nelson

1.2.7 shows the same issue. (I'm on Trac 0.11.6.)

### comment:2 Changed 6 years ago by Chris Nelson

I'm also using TicketExtPlugin 0.3. Perhaps there is some interaction.

### comment:3 Changed 6 years ago by Chris Nelson

I upgraded to TicketExtPlugin 0.3.2 (the latest for 0.11) and still see the problem.

### comment:4 Changed 6 years ago by Chris Nelson

With TicketExt disabled, I still see fields in the wrong order (some before keywords, some after).

### comment:5 Changed 6 years ago by Chris Nelson

With all T&E components disabled, I still see fields out of order. (Though Add Hours to Ticket is displayed instead of hidden.)

### comment:6 follow-up:  8 Changed 6 years ago by Russ Tyndall

There is a component (or two) in T&E that changes field order / removes whitespace... you can probably just disable those component to get your fields displaying in the correct order.

Add Hours to Ticket gets moved next to the comment box by default (so it shouldn't be hidden ever, simply moved out of the rest of the fields).

• HoursLayoutChanger — This moves the add hours box up to underneath the comment box. This prevents needing to expand the "Modify Ticket" section to add hours and a comment
• TicketPropsLayoutChanger — This removes extra whitespace rendered to the ticket properties box (and will rearrange fields to do this).

If disabling these two Components doesn't solve it, then I dont think it is something this plugin is doing.

### comment:7 follow-up:  12 Changed 6 years ago by Russ Tyndall

Also which version of trac are you running? It is possible there is a bug in trac's ordering of these boxes by default (though it seems unlikely).

I too have had a very difficult time getting the boxes to be arranged in a specific order that doesnt change between different trac instances. Not sure what the answer here is. That is part of why I ended up just moving the hours up to near the comment box.

### comment:8 in reply to:  6 Changed 6 years ago by Chris Nelson

There is a component (or two) in T&E that changes field order / removes whitespace... you can probably just disable those component to get your fields displaying in the correct order.

Add Hours to Ticket gets moved next to the comment box by default (so it shouldn't be hidden ever, simply moved out of the rest of the fields).

That sounds like you're referring to the bottom of the ticket page where you can add and change values. I'm talking about the first box on the page where current values are displayed.

• HoursLayoutChanger — This moves the add hours box up to underneath the comment box. This prevents needing to expand the "Modify Ticket" section to add hours and a comment
• TicketPropsLayoutChanger — This removes extra whitespace rendered to the ticket properties box (and will rearrange fields to do this).

If disabling these two Components doesn't solve it, then I dont think it is something this plugin is doing.

Even with all T&E components disabled, the fields are in the wrong place. Does any installed JavaScript honor the component enabling/disabling?

### comment:9 follow-up:  10 Changed 6 years ago by Russ Tyndall

I'm talking about the first box on the page where current values are displayed

Ahh... Im sorry I thought you were talking about the fields in the "Modify Ticket" section.

Any installed javascript will definitely honor the component enabling/disabling. All javascript is added from within a component (which should only be around if enabled).

Im not totally sure trac pays any attention to order when displaying the fields. I am fairly sure the order is only used in the modify section, but I am looking in the trac source to verify this assumption.

### comment:10 in reply to:  9 Changed 6 years ago by Chris Nelson

I'm talking about the first box on the page where current values are displayed

Ahh... Im sorry I thought you were talking about the fields in the "Modify Ticket" section.

Any installed javascript will definitely honor the component enabling/disabling. All javascript is added from within a component (which should only be around if enabled).

Im not totally sure trac pays any attention to order when displaying the fields. I am fairly sure the order is only used in the modify section, but I am looking in the trac source to verify this assumption.

I've been poking in Trac source, too. It appears that custom fields are added in order. ticket/api.py:_get_custom_fields() sorts by order before returning.

### comment:11 follow-up:  13 Changed 6 years ago by Russ Tyndall

• Custom fields seem are sorted by order then name
• I am not seeing anywhere that all fields are ordered after this. If we look at the fields function it builds up the list of fields by appending things into a list then returning it. I'm not seeing where anything sorting after that, though something must change their order because all customs should come after keywords.
• I just looked at a couple of my trac environments (we run about 20), and the ones I checked all had all custom fields appearing after keywords/CC, so I strongly suspect that its not entirely the fault of T&E (though this plugin could be exacerbating something else).
• I noticed that the TicketWebUiAddon Component does add some javascript (when enabled) that changes stuff in that section (but mostly by hiding stuff and displaying float hours as hours and minutes). Even with this enabled all my custom fields appear after all standard trac fields.
• You could try disabling js in your browser to see if that fixes it. You could also try disabling all plugins to verify that it is one of the plugins causing this (assuming they all add JS correctly and only when enabled).

Hope this helps, Please let me know if there is more I can do

### comment:12 in reply to:  7 Changed 6 years ago by Chris Nelson

Also which version of trac are you running? It is possible there is a bug in trac's ordering of these boxes by default (though it seems unlikely).

0.11.6.

I too have had a very difficult time getting the boxes to be arranged in a specific order that doesnt change between different trac instances. Not sure what the answer here is. That is part of why I ended up just moving the hours up to near the comment box.

Everything I find says that the fields are handled in the configured order with some exception for textarea-type fields.

My working theory is that I don't have Severity configured in my system and it is somehow using the empty cell in the top table that would be used by Severity but that doesn't really make sense.

I've dumped out the list of fields after ticket/api.py builds it and it is in the right order. I can't figure out how to instrument the Genshi template to log how it is handling fields.

### comment:13 in reply to:  11 Changed 6 years ago by Chris Nelson

Yes, I found that, too.

• I am not seeing anywhere that all fields are ordered after this. If we look at the fields function it builds up the list of fields by appending things into a list then returning it. I'm not seeing where anything sorting after that, though something must change their order because all customs should come after keywords.

You'd think so. It's hard to be sure but I *swear* when my system is bogged down I *see* it insert before Keywords so it seems Keywords is processed then the later fields get put in the wrong place.

• I just looked at a couple of my trac environments (we run about 20), and the ones I checked all had all custom fields appearing after keywords/CC, so I strongly suspect that its not entirely the fault of T&E (though this plugin could be exacerbating something else).

OK. Thanks.

• I noticed that the TicketWebUiAddon Component does add some javascript (when enabled) that changes stuff in that section (but mostly by hiding stuff and displaying float hours as hours and minutes). Even with this enabled all my custom fields appear after all standard trac fields.

Don't have that one.

• You could try disabling js in your browser to see if that fixes it. You could also try disabling all plugins to verify that it is one of the plugins causing this (assuming they all add JS correctly and only when enabled).

No. With JavaScript disabled -- FireBug complains when I open it -- my fields are still in the wrong order.

Hope this helps,

Not much. But thanks for looking into it.

Please let me know if there is more I can do

If I think of something, I will.

### comment:14 Changed 5 years ago by Russ Tyndall

I changed all the layout changing javascript in #10977, perhaps this problem is solved now? (Though previous comments implied that this javascript was not the culprit)

### comment:15 Changed 4 years ago by anonymous

I think I have the same issue, see: trac:#11751

Can someone verify that these are related? Is there a solution yet?

Last edited 4 years ago by Ryan J Ollos (previous) (diff)

### comment:16 Changed 4 years ago by Russ Tyndall

Your bug doesn't seem directly related to this ticket but your bug could the fault of this plugin.

You could try disabling the HoursLayoutChanger subcomponent in trac admin and see if that solves your issue.

Cheers

### comment:17 Changed 4 years ago by anonymous

That solved my issue. Big thanks :-)

### comment:18 Changed 13 months ago by Russ Tyndall

In 16690:

make HoursLayoutChanger respect long fields (colspan=3)

re #10547
re #11657

### comment:19 Changed 13 months ago by Russ Tyndall

Resolution: → fixed new → closed

This bug is probably unrelated, but I further rewrote the HoursLayoutChanger to try and be more predictable and respect long fields see #11657

### Modify Ticket

Change Properties