Opened 7 years ago

Closed 7 years ago

#8634 closed defect (worksforme)

Error: Macro TracJSGanttChart(milestone=Moe) failed estimatedhours

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

Description (last modified by Ryan J Ollos)


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 7 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 7 years ago by Ryan J Ollos

Description: modified (diff)

comment:3 Changed 7 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Chris Nelson.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.