Opened 3 years ago

Closed 3 years ago

Last modified 2 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:

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:

# 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

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/", line 484, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/home/salmon/env/lib/python2.6/site-packages/trac/wiki/", line 180, in process
    text = self.processor(text)
  File "/home/salmon/env/lib/python2.6/site-packages/trac/wiki/", line 167, in _macro_processor
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/", line 606, in expand_macro
    tasks = self._add_tasks(options)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/", line 552, in _add_tasks,
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/", line 545, in computeSchedule
    self.scheduler.scheduleTasks(options, tickets)
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/", line 929, in scheduleTasks
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/", line 758, in _schedule_task_alap
    finish =
  File "/home/salmon/env/lib/python2.6/site-packages/tracjsgantt/", line 182, in parseFinish
  File "/usr/lib/python2.6/", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/", line 328, in _strptime
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 2 years ago by rjollos

  • Description modified (diff)

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

Replying to vclark:

Got it working. Typo in trac.ini.

Great. FWIW, my trac.ini has:

userfinish = text = 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

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from ChrisNelson. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.