Opened 3 years ago

Closed 3 years ago

#8634 closed defect (worksforme)

Error: Macro TracJSGanttChart(milestone=Moe) failed estimatedhours

Reported by: stefan.voelkel@… Owned by: ChrisNelson
Priority: normal Component: TracJsGanttPlugin
Severity: major Keywords:
Cc: Trac Release: 0.12

Description (last modified by rjollos)


this is in debian squeeze, with Trac 0.12 and these plugins:


The generated SELECT throws an Syntax error:

  Error: near "'Moe'": syntax error

The Problem is a stray u with t.milestone:

SELECT 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,`parents`.value AS `parents`,`estimatedhours`.value AS `estimatedhours`,`totalhours`.value AS `totalhours`
FROM ticket AS t
  LEFT OUTER JOIN ticket_custom AS `parents` ON (id=`parents`.ticket AND `parents`.name='parents')
  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
WHERE ((COALESCE(t.milestone,'')=u'Moe'))
ORDER BY COALESCE(priority.value,'')='',CAST(priority.value AS integer),

Changing the WHERE line to:

WHERE ((COALESCE(t.milestone,'')='Moe'))

fixes the syntax error (at least with sqlit3 tdb/rac.db)


Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by pb903@…

I have the same error and i've debugged you code:
I've added:

 if self.fields['estimate']:
                    msTicket[self.fields['estimate']] = 0

inside of the _add_milestones(self, options) method under the:

 if self.fields['parent']:
                    msTicket[self.fields['parent']] = 0 line

now it works ...

comment:2 Changed 3 years ago by rjollos

  • Description modified (diff)

comment:3 Changed 3 years ago by rjollos

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

The original issue reported here is likely no longer valid ... it looks like the queries have been rewritten. The issue in comment:1 is unlikely to be related, even though the same generic error results. I'll test with the estimate field set and unset and open another ticket with a patch if there is an issue.

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.