Modify ↓
#12927 closed defect (fixed)
Restore support for the "Universal Edit Button"
Reported by: | Christian Boos | Owned by: | Christian Boos |
---|---|---|---|
Priority: | low | Milestone: | 1.3.3 |
Component: | wiki system | Version: | |
Severity: | minor | Keywords: | ueb patch |
Cc: | Branch: | ||
Release Notes: |
Restored support for the Universal Edit Button. |
||
API Changes: | |||
Internal Changes: |
Description
Well, quite some time ago the browser extensions for the UniversalEditButton stopped working for me, so I forgot about it.
I gave it another try just now, and the extensions are working again for both FF and Chrome (not found any for Opera or Edge). But now it's Trac that has some trouble with the query string used by these extensions:
.../WikiStart?action=edit&version=
gives:
Invalid value for request argument version.
Suggested patch:
-
trac/wiki/web_ui.py
diff --git a/trac/wiki/web_ui.py b/trac/wiki/web_ui.py index 7f6d682..3b15966 100644
a b class WikiModule(Component): 107 107 def process_request(self, req): 108 108 action = req.args.get('action', 'view') 109 109 pagename = req.args.get('page', 'WikiStart') 110 version = req.args. getint('version')110 version = req.args.as_int('version', None) # for UEB support 111 111 old_version = req.args.getint('old_version') 112 112 113 113 if pagename.startswith('/') or pagename.endswith('/') or \ … … class WikiModule(Component): 509 509 'WIKI_VIEW' in req.perm(template_page.resource): 510 510 page.text = template_page.text 511 511 elif 'version' in req.args: 512 version = req.args.getint('version') 513 old_page = WikiPage(self.env, page.name, version) 514 req.perm(page.resource).require('WIKI_VIEW') 515 page.text = old_page.text 516 comment = _("Reverted to version %(version)s.", version=version) 512 version = req.args.as_int('version', None) # for UEB 513 if version is not None: 514 old_page = WikiPage(self.env, page.name, version) 515 req.perm(page.resource).require('WIKI_VIEW') 516 page.text = old_page.text 517 comment = _("Reverted to version %(version)s.", 518 version=version) 517 519 if action in ('preview', 'diff'): 518 520 page.readonly = 'readonly' in req.args 519 521
Attachments (0)
Change History (4)
comment:1 by , 7 years ago
Keywords: | patch added |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Committed to trunk in r16425.
comment:4 by , 7 years ago
Owner: | set to |
---|
Note:
See TracTickets
for help on using tickets.
Looks good to me. I would just add a simple unit test in WikiModuleTestCase to ensure we don't break this again.