Opened 17 months ago

Last modified 17 months ago

#14106 new defect

TemplateSyntaxError: Encountered unknown tag 'time', whenever TracHoursSidebarProvider is enabled.

Reported by: anonymous Owned by: EmeCas
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords: patch
Cc: Trac Release: 1.4

Description (last modified by Ryan J Ollos)

I know probably is an installation problem. I have already reinstalled TracHoursPlugin and dependencies two times but I can't find what I'm doing wrong.

Attachments (2)

sidebar.png (41.2 KB) - added by jdelosmozos@… 17 months ago.
sidebar-correct.png (52.1 KB) - added by jdelosmozos@… 17 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 17 months ago by Ryan J Ollos

Description: modified (diff)

Changed 17 months ago by jdelosmozos@…

Attachment: sidebar.png added

Changed 17 months ago by jdelosmozos@…

Attachment: sidebar-correct.png added

comment:2 Changed 17 months ago by anonymous

I am not a trac developer at all, so please correct me if I'm worng, but it seems like this is a compatibility issue. As per my investigation Trac 1.4 uses Jinja2 and latest version of TicketSidebarProviderPlugin was designed to use Genshi.

As per Trac documentation you can use a backward compatibility mode until version 1.5. I've just hacked trachours/ using this trick in content method of TracHoursSidebarProvider class:

return Chrome(self.env). \

The result is this. Apparently is working but I'm going to do some tests.

comment:3 Changed 17 months ago by jdelosmozos@…

Adding hours through the sidebar form results in a CRSF error.

To correct that I have included the request token in the template data in trachours/

        data = {'worker': req.authname,
                'action': req.href('hours',,
                'token': req.form_token }

I have also changed the template so that it send the token:

      <input type="hidden" name="worker" value="${worker}"/>
      <input type="hidden" name="__FORM_TOKEN" value="${token}"/>
      <input type="submit" name="addhours" value="Add Hours"/>

With these two changes everything is working fine so far.

comment:4 Changed 17 months ago by figaro

Keywords: patch added

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain EmeCas.

Add Comment

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

Note: See TracTickets for help on using tickets.