Modify ↓
Opened 12 years ago
#10956 new defect
Macro TracJSGanttChart fails when using Trac 1.1.1's date ticket fields
Reported by: | Owned by: | Chris Nelson | |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.2 |
Description
Set custom ticket fields userstart and userfinish to "time":
userfinish = time userfinish.format = date userfinish.label = Due Date userstart = time userstart.format = date userstart.label = Start Date
to get a nice date chooser widget with Trac 1.1.1. When displaying a JsGantt chart with a date entered into either field, this error is triggered:
2013-03-19 17:42:13,023 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=Milestone 1) failed: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/Trac-1.1.1-py2.7.egg/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/local/lib/python2.7/dist-packages/Trac-1.1.1-py2.7.egg/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/local/lib/python2.7/dist-packages/Trac-1.1.1-py2.7.egg/trac/wiki/formatter.py", line 343, in _macro_processor text) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracjsgantt.py", line 727, in expand_macro tasks = self._add_tasks(options) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracjsgantt.py", line 662, in _add_tasks self.pm.computeSchedule(options, self.tickets) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1027, in computeSchedule self.scheduler.scheduleTasks(options, ticketsByID) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1893, in scheduleTasks serialSGS(_schedule_task_asap, 'npred', 0, self.pm.successors) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1850, in serialSGS scheduleFunction(ticket) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1602, in _schedule_task_asap if self.pm.isSet(t, 'start'): File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 247, in isSet and len(ticket[self.fields[field]]) != 0: TypeError: object of type 'datetime.datetime' has no len()
Changing the type of the field to "text", the error changes to:
2013-03-19 17:57:01,380 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=Milestone 1) failed: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/Trac-1.1.1-py2.7.egg/trac/wiki/formatter.py", line 765, in _macro_formatter return macro.ensure_inline(macro.process(args)) File "/usr/local/lib/python2.7/dist-packages/Trac-1.1.1-py2.7.egg/trac/wiki/formatter.py", line 356, in process text = self.processor(text) File "/usr/local/lib/python2.7/dist-packages/Trac-1.1.1-py2.7.egg/trac/wiki/formatter.py", line 343, in _macro_processor text) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracjsgantt.py", line 727, in expand_macro tasks = self._add_tasks(options) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracjsgantt.py", line 662, in _add_tasks self.pm.computeSchedule(options, self.tickets) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1027, in computeSchedule self.scheduler.scheduleTasks(options, ticketsByID) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1893, in scheduleTasks serialSGS(_schedule_task_asap, 'npred', 0, self.pm.successors) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1850, in serialSGS scheduleFunction(ticket) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 1604, in _schedule_task_asap start = self.pm.parseStart(t) File "/usr/local/lib/python2.7/dist-packages/Trac_jsGantt-0.10_r12565-py2.7.egg/tracjsgantt/tracpm.py", line 276, in parseStart self.dbDateFormat)) TracError: Ticket 4999 has an invalid userstart value, "001363647600000000". It should match the format "%Y-%m-%d".
Attachments (0)
Note: See
TracTickets for help on using
tickets.