Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#9675 closed defect (fixed)

userstart and userfinish fields cause errors on gant chart and roadmap

Reported by: vclark Owned by: ChrisNelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by rjollos)

What is the correct way to add userstart and userfinish date fields. Also, is there a way to make them proper date fields that enforces formatting instead of text?

I installed TracJsGanttPlugin and added [TracPM] section to trac.ini. I only added the custom start and end fields, I did not add the sections for master tickets or sub/child tickets plugins. I am trying to add things incrementally to see what I want to use.

First I added the [TracPM] section. The date fields did not appear on my tickets so I realized I probably needed to add custom fields to the tickets. So I added this to my trac.ini:

[ticket-custom]
userstart = text
userstart.label = Start Date
userfinish = text
userfinish.label = End Date

The fields show up on my tickets. But if I try to access a gantt chart I get:

Error: Macro TracJSGanttChart(milestone=WC7 Upgrade) failed

Query filter requires field and constraints separated by a "="

And if I go to Roadmap I get:

Trac detected an internal error:

TypeError: cannot concatenate 'str' and 'NoneType' objects

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by vclark

I solved the roadmap issue, it was unrelated to this plugin.

Still having trouble with start and end dates. Here are the relevant sections of my trac.ini:

[TracPM]
# Custom fields for start and due dates
# Ticket field to use as the data source for start date (default: None)
ields.start = userstart
## Ticket field to use as the data source for finish date (default: None)
fields.finish = userfinish
#
# Format for ''start'' and ''finish'' date strings (default: '%Y-%m-%d')
#date_format = %Y-%m-%d

[ticket-custom]
userstart = text
userstart.label = Start Date
userfinish = text
userfinish.label = End Date

When I try to view a gantt chart containing a ticket with start and end dates I get the following error. Note that it doesn't seem to error on the start date, just the end date.
Also, if I enter a start date but no end date I do not get the error, but the gantt chart doesn't show the proper start date. It just shows today as the start date.

2012-01-07 21:57:11,894 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=WC7 Upgrade) failed:
Traceback (most recent call last):
  File "/home/salmon/env/lib/python2.6/site-packages/trac/wiki/formatter.py", line 484, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/home/salmon/env/lib/python2.6/site-packages/trac/wiki/formatter.py", line 180, in process
    text = self.processor(text)
  File "/home/salmon/env/lib/python2.6/site-packages/trac/wiki/formatter.py", line 167, in _macro_processor
    text)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/tracjsgantt.py", line 606, in expand_macro
    tasks = self._add_tasks(options)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/tracjsgantt.py", line 552, in _add_tasks
    self.pm.computeSchedule(options, self.tickets)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/tracpm.py", line 545, in computeSchedule
    self.scheduler.scheduleTasks(options, tickets)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/tracpm.py", line 929, in scheduleTasks
    _schedule_task_alap(self.ticketsByID[id])
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/tracpm.py", line 758, in _schedule_task_alap
    finish = self.pm.parseFinish(t)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/tracpm.py", line 182, in parseFinish
    self.dbDateFormat)[0:7])
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 328, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: 1/31/2012

comment:2 follow-up: Changed 3 years ago by vclark

  • Resolution set to fixed
  • Status changed from new to closed

Got it working. Typo in trac.ini.

comment:3 Changed 3 years ago by rjollos

  • Description modified (diff)

comment:4 in reply to: ↑ 2 Changed 3 years ago by ChrisNelson

Replying to vclark:

Got it working. Typo in trac.ini.

Great. FWIW, my trac.ini has:

userfinish = text
userfinish.date = true
userfinish.date_empty = true
userfinish.label = Due Date
userfinish.order = 17
userstart = text
userstart.label = Start Date
userstart.order = 2

The .date makes the DateFieldPlugin pop up a calendars to select a date.

Add Comment

Modify Ticket

Action
as closed The owner will remain ChrisNelson.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.