Ticket #1829 (closed defect: fixed)
ImageMacro may fail on WikiStart page
| Reported by: | Shun-ichi Goto <gotoh@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9 |
| Component: | wiki system | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: |
Description
As same issue with #1802, ImageMacro? raises exception. There's a workaround patch until formatter provides correct path info. This patch also contains bug fix of split count to retrieve 'id' part correctly.
--- macros.py (revision 2017)
+++ macros.py (working copy)
@@ -314,7 +314,9 @@
# FIXME: should be retrieved from the formatter...
# ...and the formatter should be provided to the macro
file = filespec
- module, id = req.hdf['HTTP.PathInfo'].split('/', 3)[1:]
+ items = req.hdf['HTTP.PathInfo'].split('/', 2) + [None, None]
+ module = items[1] or 'wiki'
+ id = items[2] or 'WikiStart'
if module not in ['wiki', 'ticket']:
raise Exception('Cannot reference local attachment from here')
else:
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


