Edgewall Software

Opened 5 years ago

Last modified 5 years ago

#13192 closed defect

KeyError for Query.get_modes().get(...) — at Version 1

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.2.5
Component: query system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Found in log files:

2019-08-13 03:56:35,690 Trac[main] ERROR: [23.94.17.122] Internal Server Error: <RequestWithSession "POST '/query'">, referrer 'https://bugs.jqueryui.com/'
Traceback (most recent call last):
  File "/var/www/bugs.jqueryui.com/private/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 648, in _dispatch_request
    dispatcher.dispatch(req)
  File "/var/www/bugs.jqueryui.com/private/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 249, in dispatch
    resp = chosen_handler.process_request(req)
  File "/var/www/bugs.jqueryui.com/private/pve/local/lib/python2.7/site-packages/trac/ticket/query.py", line 941, in process_request
    constraints = self._get_constraints(req)
  File "/var/www/bugs.jqueryui.com/private/pve/local/lib/python2.7/site-packages/trac/ticket/query.py", line 1099, in _get_constraints
    modes = Query.get_modes().get(fields[field]['type'])
KeyError: u"paU7mLAp'))"

Change History (1)

comment:1 by Ryan J Ollos, 5 years ago

Description: modified (diff)

Proposed change:

  • trac/ticket/query.py

    diff --git a/trac/ticket/query.py b/trac/ticket/query.py
    index 1f3883b78..274d0706d 100644
    a b class QueryModule(Component):  
    10941094            if add_num is not None:
    10951095                field = req.args.get('add_filter_' + add_num,
    10961096                                     req.args.get('add_clause_' + add_num))
    1097                 if field:
     1097                if field and field in fields:
    10981098                    clause = constraints.setdefault(int(add_num), {})
    10991099                    modes = Query.get_modes().get(fields[field]['type'])
    11001100                    mode = modes[0]['value'] if modes else ''
Note: See TracTickets for help on using tickets.