Opened 14 years ago
Closed 14 years ago
#8573 closed defect (worksforme)
no access to 'estimatedhours' when executing macro
Reported by: | Jan Boehme | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | highest | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
Here the macro which is called in the main wiki page: " [ [ TracJSGanttChart(milestone=K10-BOSCH-03) ] ]"
Results in the following error message in trac.log:
2011-03-07 14:32:50,793 Trac[formatter] DEBUG: Executing Wiki macro TracJSGanttChart by provider <tracjsgantt.tracjsgantt.TracJSGanttChart object at 0x7f7804b008d0>
2011-03-07 14:32:50,793 Trac[formatter] DEBUG: Executing Wiki macro TracJSGanttChart by provider <tracjsgantt.tracjsgantt.TracJSGanttChart object at 0x7f7804b008d0>
2011-03-07 14:32:50,800 Trac[query] DEBUG: Count results in Query: 8
2011-03-07 14:32:50,800 Trac[query] DEBUG: Query SQL: SELECT t.id AS id,t.description AS description,t.owner AS owner,t.type AS type,t.status AS status,t.summary AS summary,t.milestone AS milestone,t.priority AS priority,t.time AS time,t.changetime AS changetime,priority.value AS priority_value,blockedby
.value AS blockedby
,blocking
.value AS blocking
,estimatedhours
.value AS estimatedhours
,totalhours
.value AS totalhours
FROM ticket AS t
LEFT OUTER JOIN ticket_custom AS
blockedby
ON (id=blockedby
.ticket ANDblockedby
.name='blockedby') LEFT OUTER JOIN ticket_custom ASblocking
ON (id=blocking
.ticket ANDblocking
.name='blocking') LEFT OUTER JOIN ticket_custom ASestimatedhours
ON (id=estimatedhours
.ticket ANDestimatedhours
.name='estimatedhours') LEFT OUTER JOIN ticket_custom AStotalhours
ON (id=totalhours
.ticket ANDtotalhours
.name='totalhours') LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND priority.name=priority)
WHERE ((COALESCE(t.milestone,)=u'K10-BOSCH-03')) ORDER BY COALESCE(priority.value,)=,CAST(priority.value AS integer),t.id 2011-03-07 14:32:50,808 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=K10-BOSCH-03) failed: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 717, in _macro_formatter
return macro.process(args, in_paragraph=True)
File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 304, in process
text = self.processor(text)
File "/usr/lib/python2.7/site-packages/trac/wiki/formatter.py", line 291, in _macro_processor
text)
File "/usr/lib/python2.7/site-packages/Trac_jsGantt-0.3-py2.7.egg/tracjsgantt/tracjsgantt.py", line 620, in expand_macro
tasks = self._add_tasks(options)
File "/usr/lib/python2.7/site-packages/Trac_jsGantt-0.3-py2.7.egg/tracjsgantt/tracjsgantt.py", line 598, in _add_tasks
tasks += self._format_ticket(ticket, options)
File "/usr/lib/python2.7/site-packages/Trac_jsGantt-0.3-py2.7.egg/tracjsgantt/tracjsgantt.py", line 532, in _format_ticket
task += '"%s",' % _start(t)
File "/usr/lib/python2.7/site-packages/Trac_jsGantt-0.3-py2.7.egg/tracjsgantt/tracjsgantt.py", line 491, in _start
days = _workDays(t)
File "/usr/lib/python2.7/site-packages/Trac_jsGantt-0.3-py2.7.egg/tracjsgantt/tracjsgantt.py", line 457, in _workDays
KeyError: u'estimatedhours'
Maybe something wasn't upgraded well oor there is no 'estimatedhours' in the current table. The belonging values can be found in 'ticket_custom' table. Can anyone help here?
Thanks, Jan.
Attachments (1)
Change History (11)
Changed 14 years ago by
Attachment: | gantt_error.png added |
---|
comment:1 Changed 14 years ago by
Got similar error message with malformed date field. Recovered by correctly formating data. Try
- a query where you can see on the column
estimatedhours
and correct (if any) wherever you can have a malformed field (ca be: decimal number split by a colon instead of a dot, a letter, ...) - a different milestone with just few tickets on in (newly created for testing and where you controlled all the field contents).
comment:2 follow-up: 3 Changed 14 years ago by
Ops, sorry I was thinking I was on TracJsGanttPlugin. Hope this works here too.
comment:3 Changed 14 years ago by
Component: | GanttChartPlugin → TracJsGanttPlugin |
---|---|
Owner: | changed from malsmith to Chris Nelson |
Replying to AdrianFritz:
Ops, sorry I was thinking I was on TracJsGanttPlugin. Hope this works here too.
No I'm sorry. Actually it is the TracJsGanttPlugin. I'll give it a try, thanks.
comment:4 Changed 14 years ago by
I created a new milestone, added a ticket with a new set 'estimatedhours' value and even this tiny sample gives the error output. I made a custom query like "sqlite3 trac.db "SELECT * FROM ticket_custom" | grep stimatedhours but it gives me regualar output for each ticket:
... 127|estimatedhours|1 128|estimatedhours|1.5 129|estimatedhours|0 130|estimatedhours|0 131|estimatedhours|0 132|estimatedhours|0 133|estimatedhours|0 134|estimatedhours|4.0 135|estimatedhours|3 ...
comment:5 follow-up: 6 Changed 14 years ago by
Summary: | no access to 'estimatedhours' wwhen executing macro → no access to 'estimatedhours' when executing macro |
---|
Are you using the Timing and Estimation plugin for estimated hours?
Can you post the Trac-jsGantt section of your trac.ini?
comment:6 Changed 14 years ago by
Replying to ChrisNelson:
Are you using the Timing and Estimation plugin for estimated hours?
Yes. There seems a ticket-custom table in the db and a ticket-custom section in the ini:
[ticket-custom] billable = checkbox billable.label = Billable? billable.order = 3 billable.value = 1 blockedby = text blockedby.label = Blocked By blocking = text blocking.label = Blocking estimatedhours = text estimatedhours.label = Estimated Number of Hours estimatedhours.order = 1 estimatedhours.value = 0 hours = text hours.label = Add Hours to Ticket hours.order = 2 hours.value = 0 totalhours = text totalhours.label = Total Hours totalhours.order = 4 totalhours.value = 0
Also I use the MasterTicketsPlugin
mastertickets.api.masterticketssystem = enabled mastertickets.web_ui.masterticketsmodule = enabled
Can you post the Trac-jsGantt section of your trac.ini?
Of course:
[trac-jsgantt] days_per_estimate = 0.125 fields.estimate = estimatedhours fields.pred = blockedby fields.succ = blocking fields.worked = totalhours
Enabled in the following way:
tracjsgantt.tracjsgantt.taacjsganttsupport = enabled tracjsgantt.tracjsgantt.tracjsganttchart = enabled
comment:7 Changed 14 years ago by
Same configuration (minor differences for default values and ticket-custom item order) Other details below:
[trac-jsgantt] # TracPlugin --> Help @ .../wiki/Tool/TracJsGanttPlugin date_format = %Y-%m-%d days_per_estimate = 0.125 fields.finish = due_close fields.percent = complete fields.pred = blockedby fields.start = due_assign fields.succ = blocking fields.parent = parents milestone_type = milestone
comment:8 Changed 14 years ago by
I changed my settings to the following and the error message is away but now I have a new problem: nothing can be seen neither the sample nor my milestones gantt.
... [[TracJSGanttChart(sample=1)]] [[TracJSGanttChart(milestone=K10-BOSCH-03)]] ...
[trac-jsgantt] # TracPlugin --> Help @ .../wiki/Tool/TracJsGanttPlugin date_format = %Y-%m-%d days_per_estimate = 0.125 #fields.finish = due_close #fields.percent = complete fields.pred = blockedby #fields.start = due_assign fields.succ = blocking #fields.parent = parents milestone_type = milestone
comment:9 Changed 14 years ago by
Further examination brings me to the following JS error message in Google-Chrome:
jsgantt.js:1119Uncaught ReferenceError: vPopupFeatures is not defined
The jsgantt.js included in this plugin isn't the latest version from the website http://jsgantt.com. Do I have to expect trouble simply updating it?
comment:10 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I updated the htdocs to the latest version from the jsgantt website and it seems to work now. Thanks.
error in wiki screenshot