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 , 18 years ago
comment:2 by , 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 , 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 , 18 years ago
Owner: | changed from | to
---|
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 underAttachmentModule.process_request
in attachment.pyMaybe it should check to see if the resource constructed from the full bit exists, otherwise try it with the last bit as the filename.