Modify ↓
#11531 closed defect (fixed)
KeyError: 'panel_id' (PreferencesModule can't be set as default_handler)
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | default_handler, preferences |
Cc: | Branch: | ||
Release Notes: |
|
||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /
, Trac issued an internal error.
With [trac] default_handler = PreferencesModule
.
Request parameters:
{}
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36
System Information
Trac | 1.1.2dev-r0
|
Babel | 0.9.6 (translations unavailable)
|
Docutils | 0.10
|
Genshi | 0.6.1 (without speedups)
|
GIT | 1.8.1.2
|
Pygments | 1.6dev-20140311
|
pysqlite | 2.6.3
|
Python | 2.7.4 (default, Sep 26 2013, 03:20:26) [GCC 4.7.3]
|
pytz | 2013d
|
setuptools | 0.6
|
SQLite | 3.7.15.2
|
Subversion | 1.8.8 (r1568071)
|
jQuery | 1.8.3
|
Enabled Plugins
Python Traceback
Traceback (most recent call last): File "/home/user/Workspace/t11519/teo-rjollos.git/trac/web/main.py", line 517, in _dispatch_request dispatcher.dispatch(req) File "/home/user/Workspace/t11519/teo-rjollos.git/trac/web/main.py", line 221, in dispatch resp = chosen_handler.process_request(req) File "/home/user/Workspace/t11519/teo-rjollos.git/trac/prefs/web_ui.py", line 71, in process_request panel_id = req.args['panel_id'] KeyError: 'panel_id'
It's a bit of a corner case, but the fix is easy.
-
trac/prefs/web_ui.py
diff --git a/trac/prefs/web_ui.py b/trac/prefs/web_ui.py index 5a428c2..a15a3de 100644
a b class PreferencesModule(Component): 68 68 if xhr and req.method == 'POST' and 'save_prefs' in req.args: 69 69 self._do_save_xhr(req) 70 70 71 panel_id = req.args ['panel_id']71 panel_id = req.args.get('panel_id') 72 72 73 73 panels = [] 74 74 chosen_provider = None
Attachments (0)
Change History (3)
comment:1 by , 11 years ago
Reporter: | changed from | to
---|
comment:2 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:3 by , 10 years ago
Keywords: | default_handler preferences → default_handler, preferences |
---|
Note:
See TracTickets
for help on using tickets.
Fixed in [12573] and merged to trunk in [12576]. A TODO has been added in comment:7:ticket:11520.