Modify ↓
Opened 7 years ago
Closed 7 years ago
#12958 closed defect (fixed)
Query page raises a TypeError if custom field named "id" exists
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.17 |
Component: | ticket system | Version: | 1.0.15 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fix query crashing when |
||
API Changes: | |||
Internal Changes: |
Description
How to reproduce
- Create new environment —
initenv
- Add a custom field named "id" —
config set ticket-custom id text
- Create new ticket
- Visit
/query?status=!closed
07:39:35 PM Trac[main] ERROR: [192.168.11.25] Internal Server Error: <RequestWithSession "GET '/query?status=!closed'">, referrer None Traceback (most recent call last): File "/venv/trac/1.0.15/lib/python2.5/site-packages/trac/web/main.py", line 567, in _dispatch_request dispatcher.dispatch(req) File "/venv/trac/1.0.15/lib/python2.5/site-packages/trac/web/main.py", line 249, in dispatch resp = chosen_handler.process_request(req) File "/venv/trac/1.0.15/lib/python2.5/site-packages/trac/ticket/query.py", line 1004, in process_request return self.display_html(req, query) File "/venv/trac/1.0.15/lib/python2.5/site-packages/trac/ticket/query.py", line 1102, in display_html tickets = query.execute(req) File "/venv/trac/1.0.15/lib/python2.5/site-packages/trac/ticket/query.py", line 334, in execute val = int(val) TypeError: int() argument must be a string or a number, not 'NoneType'
We should add id
to reserved field names in TicketSystem
:
-
trac/ticket/api.py
diff --git a/trac/ticket/api.py b/trac/ticket/api.py index f032664a2..33396c5c0 100644
a b class TicketSystem(Component): 364 364 365 365 reserved_field_names = ['report', 'order', 'desc', 'group', 'groupdesc', 366 366 'col', 'row', 'format', 'max', 'page', 'verbose', 367 'comment', 'or' ]367 'comment', 'or', 'id'] 368 368 369 369 def get_custom_fields(self): 370 370 return copy.deepcopy(self.custom_fields)
I'll post unit tests later.
Attachments (0)
Change History (3)
comment:1 by , 7 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 7 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Thanks. Committed in [16403] and merged in [16404,16405].
Note:
See TracTickets
for help on using tickets.
Proposed changes in [b4c1e5862/jomae.git].