Modify

Opened 4 years ago

#8835 new enhancement

fields layout is broken if dynamicfields plugin enabled

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

Description

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

Index: branches/0.11/trachours/hours.py
===================================================================
--- branches/0.11/trachours/hours.py    (revision 10223)
+++ branches/0.11/trachours/hours.py    (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)
             else:
                 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 (0)

Add Comment

Modify Ticket

Action
as new The owner will remain rjollos.
Author


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

 
Note: See TracTickets for help on using tickets.