Ticket #4001 (closed defect: fixed)
Error: Macro TicketQuery(...) failed
| Reported by: | ilias@… | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | query |
| Cc: |
Description
Just updated to the latest version, and got an error.
Reproduction:
within wiki, add this macro call:
fails: [[TicketQuery(status=assigned|new|reopened&order=type, format=table)]] works: [[TicketQuery(status=assigned|new|reopened&order=type)]]
error message:
load_template() takes at most 3 arguments (4 given)
Attachments
Change History
comment:2 Changed 4 years ago by cmlenz
- Keywords query added
- Owner changed from jonas to cmlenz
- Status changed from new to assigned
- Component changed from general to ticket system
- Milestone set to 0.11
Oops, that'd be my fault. This should be fixed in the macro anyway, as passing data to the load_template method seems wrong.
comment:3 Changed 4 years ago by ilias@…
yes, it seems wrong. Although the description sounds rational, too:
def load_template(self, filename, req=None, data=None, method=None):
"""Retrieve a Template and optionally preset the template data.
If `req` and `data` are given, the `data` dictionary will be preset
with the "standard" Trac information and helper methods.
Also, if the optional `method` argument is set to `'text'`, a
TextTemplate instance will be created instead of a MarkupTemplate.
"""
btw: who will do the change?
Possibly he can apply those patches, too: #3990
comment:4 Changed 4 years ago by cmlenz
- Status changed from assigned to closed
- Resolution set to fixed
Fixed in [4009].
comment:6 Changed 4 years ago by ilias@…
It would be nice if a commit subjecting a ticket would just cover that ticket, especially if it was a regression.
- introduces "fromtimestamp(result.time)" within query.rss
- renames render_response to render_template
- add a parameter to render_template
- exchanges "load_template" by "render_template"
- introduces signature change to "render_template"
- corrects query.py (Macro TicketQuery)
"Trac" assists to keep development trackable, but of course it depends on the developers discipline, too.



caused by a signature change to this method:
def load_template(self, filename, req=None, data=None, method=None):
def load_template(self, filename, method=None):
http://trac.edgewall.org/changeset/4007/trunk/trac/web/chrome.py