[Trac-tickets] [The Trac Project] #1802: attachment link on WikiStart page

The Trac Project noreply at edgewall.com
Tue Jul 19 05:05:17 CDT 2005


#1802: attachment link on WikiStart page
--------------------+-------------------------------------------------------
       Id:  1802    |      Status:  new                               
Component:  wiki    |    Modified:  Tue Jul 19 05:05:17 2005          
 Severity:  normal  |   Milestone:                                    
 Priority:  normal  |     Version:  devel                             
    Owner:  jonas   |    Reporter:  Shun-ichi Goto <gotoh at taiyo.co.jp>
--------------------+-------------------------------------------------------
 When I accessing WikiStart page without explicit wiki pagename like:
 http://trac.my.local.net/trac or http://trac.my.local.net/trac/wiki,
 the rendering of attachment link for current page (like
 {{{[attachment:file text]}}})
 will cause "Index out of range" exception at attachment.py:456.

 I made temporary fix for myself as bellow, but I don't know right way to
 fix.
 {{{
 --- attachment.py       (revision 1986)
 +++ attachment.py       (working copy)
 @@ -452,8 +452,9 @@
              # FIXME: the formatter should know to which object belongs
              #        the text being formatted
              #        (this info will also be required for
 TracCrossReferences)
 -            path_info = formatter.req.path_info.split('/',2)
 -            parent_type, parent_id = path_info[1], path_info[2] # Kludge
 for now
 +            path_info = formatter.req.path_info.split('/',2) + [None,
 None]
 +            parent_type = path_info[1] or 'wiki'
 +            parent_id = path_info[2] or 'WikiStart'
              filename = link
          try:
              attachment = Attachment(self.env, parent_type, parent_id,
 filename)
 }}}

 (I'm using r1986)

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/1802>
The Trac Project <>


More information about the Trac-Tickets mailing list