Description
The message displayed after an attempted upload at the top of the attachment page is incorrect when uploading a file that has the same name as a current attachment and the Overwrite existing attachment of same name checkbox is not checked. The old attachment of the same name will not be overwritten, which the desired result since the checkbox was not checked. However, the message at the top of the page should reflect this outcome by saying something about the upload failing because an attachment with the same name already exists. Instead, the message says the same thing as a message after a successful upload, which is "Attachment 'X' (remote name 'X') with X bytes saved." This message will also be displayed if a file is uploaded to a page and the Rename to textbox is used to rename the attachment to an existing attachment name.
I've found this to be a problem because after I've upload files, I'd see the message and go do something else without checking the attachment to make sure it is the actual file I uploaded. To me, the message was my confirmation that everything worked. It turns out it didn't.
Steps to reproduce
- Create a simple text file on your computer with a few words in it to identify its version.
- Attach the file to any page. (preferably a page without attachments to see the changes better)
- Clear the message at the top of the attachment page. Go back to the same attachment page (the site probably navigated away from the attachment page).
- Open the original file that is on your computer and change the contents to identify its version. Keep the filename the same.
Try to attach the new file on your computer without changing the filename (attempting to overwrite the attachment with the same filename). Make sure the Overwrite existing attachment of same name checkbox is not checked. The message at the top of the attachment page will show a success message (the attachment was saved). The actual file on the attachment page will be the original attachment (it wasn't overwritten) since it shouldn't have been.
- Clear the message at the top of the attachment page. Go back to the same attachment page.
Try again to attach the new file again without changing the filename. This time check the Overwrite existing attachment of same name checkbox. The message that appears at the top of the attachment page will show a success message, as it should since the attachment was overwritten. The actual file on the attachment page will be the new file. This can be confirmed by the upload date and time and by opening the file to see it is the second test file with the same filename.
Example
The screenshot below shows the successfully saved message of the second file with the same filename and the fact that the "saved" file is different from the actual file attached by way of the file sizes.
Component selection
- general
Details
MoinMoin Version |
1.6.3 |
OS and Version |
Fedora 9 running Linux 2.6.25.6-55.fc9.i686 |
Python Version |
2.5.1 |
Server Setup |
MoinMoin Standalone Server |
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
<Browser setting> (which is English) |
Workaround
Discussion
Can't reproduce here, so it seems fixed in 1.7.
Plan
- Priority:
- Assigned to:
- Status: fixed in 1.7 fixed in 1.6 by Changeset 2665:c8bdc6c922e7