Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#4812 closed defect (fixed)

File attachment to a subwikipage triggers an internal error

Reported by: Emmanuel Blot Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: general Version: devel
Severity: minor Keywords: attachment
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When a file is attached to a sub wikipage (e.g. SandBox/Test), Trac triggers the following error message:

Attachment wiki:SandBox: Test does not exist.

It seems there is a parsing mismatch between the file path and the Wiki page separator.

Note that the file is nevertheless attached to the page, and can be accessed/retrieved/viewed without any issue, hence the 'minor' severity.

The bug shows off in Trac [4812], but it's probably older. I hope it's not a duplicate ;-)

Attachments (0)

Change History (5)

comment:1 by Tim Hatch, 18 years ago

This is because the url is ambiguous… is wiki/a/b for the page a/b or for the attachment b under the page a. The relevant part is the len(segments) bit under AttachmentModule.process_request in attachment.py

Maybe it should check to see if the resource constructed from the full bit exists, otherwise try it with the last bit as the filename.

comment:2 by Tim Hatch, 18 years ago

Thinking about it a bit more, I don't think there's a "good" way to solve it without altering the url syntax. What if you have a wiki subpage and attachment of the same name? Trac couldn't just glance at the db or try it both ways because they would both be valid.

comment:3 by Christian Boos, 18 years ago

Milestone: 0.11

The URL syntax for an attachment itself is unambiguous:

/attachment/wiki/(pagename/)+/filename

Now, the URL syntax for the list of attachments is unambiguous:

/attachment/wiki/(pagename/)+

as it collides with the above.

Simple solution would be to require a trailing slash in the above case (that gives a Bad request error right now, which means that this URL space is available :-) ).

comment:4 by Christian Boos, 18 years ago

Owner: changed from Jonas Borgström to Christian Boos

comment:5 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

Should be fixed in r4813.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.