Modify ↓
Opened 3 years ago
Last modified 3 years 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 )
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)
Change History (6)
comment:1 Changed 3 years ago by
Description: | modified (diff) |
---|
Changed 3 years ago by
Attachment: | sidebar.png added |
---|
Changed 3 years ago by
Attachment: | sidebar-correct.png added |
---|
comment:2 Changed 3 years ago by
comment:3 Changed 3 years ago by
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/web_ui.py:
data = {'worker': req.authname, 'action': req.href('hours', ticket.id), '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 3 years ago by
Keywords: | patch added |
---|
Note: See
TracTickets for help on using
tickets.
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/web_ui.py using this trick in content method of TracHoursSidebarProvider class:
The result is this. Apparently is working but I'm going to do some tests.