Modify

Opened 12 years ago

Closed 12 years ago

#10659 closed defect (fixed)

TracImgSvg no longer works due to a change in how attachments are stored.

Reported by: Nathaniel Madura Owned by: Richard Liao
Priority: high Component: TracImageSvgMacro
Severity: critical Keywords:
Cc: Trac Release: 1.0

Description

See this ticket http://trac.edgewall.org/ticket/10313 for more details, but the attachments directory has moved to files/attachments and the attachment names are SHA-1'ed along with their page name.

Attached is a unified diff of a solution to the problem. note that wiki pages can have depth "some/page/to/wiki" which is why you can't assume the wiki page is in the 5th position of the array.

Attachments (1)

web_ui.0.11_1.0.patch (933 bytes) - added by Nathaniel Madura 12 years ago.
patch to get ImgSVG working on trac 1.0

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Nathaniel Madura

Attachment: web_ui.0.11_1.0.patch added

patch to get ImgSVG working on trac 1.0

comment:1 Changed 12 years ago by Nathaniel Madura

Ahh crap, I did the patch backwards so the +'s and -'s need to be flipped.

like so...

  • imagesvg/web_ui.py

    old new  
    152152    def process_request(self, req):
    153153        if req.path_info.startswith("/svg"):
    154154            pathSegs = req.path_info.split("/")
    155             image_path = "/".join(pathSegs[2:])
    156             f = os.path.join(self.env.path, image_path)
     155            # pathSegs[1] == svg
     156            # pathSegs[2] == attachments
     157            # pathSegs[3] == wiki | ticket
     158            # pathSegs[n] == filename.ext
     159            attachment = Attachment(self.env, pathSegs[3], "/".join(pathSegs[4:-1]))
     160            attachment.filename = pathSegs[-1]
     161            self.log.info("SVG Attachment: %s" % (attachment.path))
    157162            try:
    158                 message = open(f).read()
     163                message = open(attachment.path).read()
    159164            except:
    160165                raise HTTPException(404)

comment:2 Changed 12 years ago by Richard Liao

(In [12393]) Add support for trac 1.0, apply patch from nmadura, see #10659

comment:3 Changed 12 years ago by Richard Liao

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Richard Liao.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.