Modify

Opened 3 years ago

Closed 3 years ago

#8573 closed defect (worksforme)

no access to 'estimatedhours' when executing macro

Reported by: jan.boehme@… Owned by: ChrisNelson
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 AND blockedby.name='blockedby')
LEFT OUTER JOIN ticket_custom AS blocking ON (id=blocking.ticket AND blocking.name='blocking')
LEFT OUTER JOIN ticket_custom AS estimatedhours ON (id=estimatedhours.ticket AND estimatedhours.name='estimatedhours')
LEFT OUTER JOIN ticket_custom AS totalhours ON (id=totalhours.ticket AND totalhours.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

if self.fieldsestimate? and t[self.fieldsestimate?] != :

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)

gantt_error.png (20.8 KB) - added by jan.boehme@… 3 years ago.
error in wiki screenshot

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by jan.boehme@…

error in wiki screenshot

comment:1 Changed 3 years ago by AdrianFritz

Got similar error message with malformed date field. Recovered by correctly formating data. Try

  1. 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, ...)
  2. 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: Changed 3 years ago by AdrianFritz

Ops, sorry I was thinking I was on TracJsGanttPlugin. Hope this works here too.

comment:3 in reply to: ↑ 2 Changed 3 years ago by jan.boehme@…

  • Component changed from GanttChartPlugin to TracJsGanttPlugin
  • Owner changed from malsmith to ChrisNelson

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 3 years ago by jan

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: Changed 3 years ago by ChrisNelson

  • Summary changed from no access to 'estimatedhours' wwhen executing macro to 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 in reply to: ↑ 5 Changed 3 years ago by jan.boehme@…

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 3 years ago by AdrianFritz

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 3 years ago by aiscape

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 3 years ago by aiscape

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 3 years ago by aiscape

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

I updated the htdocs to the latest version from the jsgantt website and it seems to work now.
Thanks.

Add Comment

Modify Ticket

Action
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'.
Author


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

 
Note: See TracTickets for help on using tickets.