Opened 8 years ago

Last modified 20 months ago

#8835 assigned enhancement

fields layout is broken if dynamicfields plugin enabled

Reported by: uray Owned by: EmeCas
Priority: low Component: TracHoursPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11


the field totalhours is replaced from input field to simple text in, this will confuse DynamicFieldsPlugin, following is my quick fix:

Index: branches/0.11/trachours/
--- branches/0.11/trachours/    (revision 10223)
+++ branches/0.11/trachours/    (working copy)
@@ -318,11 +318,12 @@
             ticket_id = data['ticket'].id
             if ticket_id is None: # new ticket
                 field = '0'
+                stream |= Transformer("//input[@id='field-totalhours']").attr('disabled', 'disabled').attr('value', field)
                 hours = '%.1f' % (self.get_total_hours(ticket_id) / 3600.0)
                 field = tag.a(hours, href=req.href('hours', data['ticket'].id), title="hours for ticket %s" % data['ticket'].id)
+                stream |= Transformer("//input[@id='field-totalhours']").replace(field)
             totalhours['rendered'] = field
-            stream |= Transformer("//input[@id='field-totalhours']").replace(field)

         return stream

Attachments (0)

Change History (3)

comment:1 Changed 2 years ago by Ryan J Ollos

Owner: Ryan J Ollos deleted

comment:2 Changed 20 months ago by EmeCas

Owner: set to EmeCas
Status: newassigned

comment:3 Changed 20 months ago by EmeCas

I'm trying to reproduce the issue with no success yet. May you please clarify a little better how DynamicFieldsPlugin gets confused?

Modify Ticket

Change Properties
Set your email in Preferences
as assigned The owner will remain EmeCas.

Add Comment

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

Note: See TracTickets for help on using tickets.