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

  1. Create a simple text file on your computer with a few words in it to identify its version.
  2. Attach the file to any page. (preferably a page without attachments to see the changes better)
  3. 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).
  4. Open the original file that is on your computer and change the contents to identify its version. Keep the filename the same.
  5. 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.

  6. Clear the message at the top of the attachment page. Go back to the same attachment page.
  7. 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.

screenshot.png

Component selection

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


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/AttachmentMessageIncorrectOverwriteNotChecked (last edited 2008-06-19 07:39:08 by ReimarBauer)