Edgewall Software

Ticket #4001 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Changed 2 years ago by ilias@…

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

Changed 2 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.

Changed 2 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

Changed 2 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [4009].

Changed 2 years ago by cboos

... and [4010] helps too ;)

Changed 2 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.

r4009

  • 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"

r4010

  • 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.

Changed 2 years ago by ilias@…

btw.: can I 'get' the patches mentioned in #3990 ?

Add/Change #4001 (Error: Macro TicketQuery(...) failed)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cmlenz. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.