Modify

Opened 22 months ago

Last modified 17 months ago

#10547 new defect

Plugin seems to interfere with custom field ordering

Reported by: ChrisNelson Owned by: bobbysmith007
Priority: high Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release:

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:

ReporterOwner
PriorityMilestone
ComponentVersion
CCKeywords

My custom fields are ordered:

fieldorder
estimatedhours0
confidence1
blockedby2
blocking3
build4
hours5
totalhours6
customer7
defectcause8
supplier_name9
supplier_id10
supplier_pn11
supplier_contact12
userfinish13
parents14

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

ReporterOwner
PriorityMilestone
ComponentVersion
CCKeywords
Estimated HoursConfidence
Depends OnRequired For

When I add hours, it gets added before keywords:

ReporterOwner
PriorityMilestone
ComponentVersion
CC<empty place for hidden hours>
KeywordsEstimated Hours
ConfidenceDepends On
Required For

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:

ReporterOwner
PriorityMilestone
ComponentVersion
CCBuild
emptyTotal Hours
KeywordsEstimated Hours
ConfidenceDepends On
Required ForDue 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.

Attachments (0)

Change History (14)

comment:1 Changed 22 months ago by ChrisNelson

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

comment:2 Changed 22 months ago by ChrisNelson

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

comment:3 Changed 22 months ago by ChrisNelson

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

comment:4 Changed 22 months ago by ChrisNelson

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

comment:5 Changed 22 months ago by ChrisNelson

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: Changed 22 months ago by bobbysmith007

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: Changed 22 months ago by bobbysmith007

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 22 months ago by ChrisNelson

Replying to bobbysmith007:

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: Changed 22 months ago by bobbysmith007

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 22 months ago by ChrisNelson

Replying to bobbysmith007:

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: Changed 22 months ago by bobbysmith007

  • 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 22 months ago by ChrisNelson

Replying to bobbysmith007:

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 22 months ago by ChrisNelson

Replying to bobbysmith007:

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 17 months ago by bobbysmith007

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)

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.