Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12286 closed defect (fixed)

QueryValueError: Invalid query constraint value

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.10
Component: ticket system Version:
Severity: normal Keywords: query
Cc: Branch:
Release Notes:

QueryValueError are trapped in calls to TicketQuery macro and the error message is printed.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

18:13:18 Trac[formatter] ERROR: Macro TicketQuery(created=2012. 10. 18...2012. 10. 19.) failed:
Traceback (most recent call last):
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/wiki/formatter.py", line 789, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/wiki/formatter.py", line 358, in process
    text = self.processor(text)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/wiki/formatter.py", line 345, in _macro_processor
    text)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/ticket/query.py", line 1385, in expand_macro
    tickets = query.execute(req)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/ticket/query.py", line 300, in execute
    sql, args = self.get_sql(req, cached_ids, authname, tzinfo, locale)
  File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/ticket/query.py", line 688, in get_sql
    raise QueryValueError(errors)
QueryValueError: Invalid query constraint value

I propose the following the following change:

  • trac/ticket/query.py

    diff --git a/trac/ticket/query.py b/trac/ticket/query.py
    index 9b09fa7..8cf765d 100644
    a b from trac.web.chrome import (INavigationContributor, Chrome,  
    4646                             add_script_data, add_stylesheet, add_warning,
    4747                             web_context)
    4848from trac.wiki.api import IWikiSyntaxProvider
     49from trac.wiki.formatter import system_message
    4950from trac.wiki.macros import WikiMacroBase # TODO: should be moved in .api
    5051
    5152
    class TicketQueryMacro(WikiMacroBase):  
    13821383                             cnt, query=query_string)
    13831384            return tag.span(cnt, title=title, class_='query_count')
    13841385
    1385         tickets = query.execute(req)
     1386        try:
     1387            tickets = query.execute(req)
     1388        except QueryValueError, e:
     1389            self.log.warn(e)
     1390            return system_message(_("Error executing TicketQuery macro"), e)
    13861391
    13871392        if format == 'table':
    13881393            data = query.template_data(formatter.context, tickets,

Attachments (0)

Change History (2)

comment:1 by Ryan J Ollos, 9 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [14380], merged to trunk in [14381:14382].

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.