When I submit an issue on Drupal.org with an attached file, then click on "Preview", a preview of my post appears. However, when I again press "Submit", the file ends up being not attached.

Apparently, the "File Attachment" field is being cleared somehow and the file's not being saved when you preview it.

Workaround: Preview without attaching the file, so the "Submit" button appears. Now, attach your file and click submit. Your file will be attached.

I can reproduce this using Konqueror and Firebird on Linux.

CommentFileSizeAuthor
zeroBytes.txt0 bytesirwin

Comments

robert castelo’s picture

this is also an issue in Safari

gábor hojtsy’s picture

I don't know what you are expecting. The file input field cannot get a default value for security reasons, and it is not manageable with JS for the same reason. It is not possible to keep the value of the file upload field in a form printed by the server (after you preview). This is a browser security feature, and it is not possible to workaround (or at least it should not be possible).

irwin’s picture

From a user's point of view, I would expect that the file would be attached, and would display in the Node Preview when I select "Preview". Attaching a file, and then previewing it, and having the file disappear is not expected.

If it's the case that there is a security risk and files can not be kept, then you should ensure that the submit button appears in the first time so they can submit it right away, or notify the user that the file they attached MUST be reattached if they are previewing.

gábor hojtsy’s picture

Project: Drupal.org site moderators » Project
Component: web site » User interface

This is why I have not modified the status of this issue. Some user interface modifications are needed to inform the users that the attached file will not be kept upon previewing. Recategorizing for the project module.

TDobes’s picture

Component: User interface » Issues

This is not always the case. It's worth noting that this is only true for the FIRST preview. Try the following steps:
1. create an issue
2. type a description and title, and select a file to be attached
3. click preview... note on resulting screen file is still NOT attached
4. select the file AGAIN
5. click preview again... note that this time, on the resulting screen, the file IS in fact attached (the description under the file attachment field changes)

So... this appears to be a code problem, not just something users should be informed about. project.module should store the file after the FIRST preview, just as it stores the file after the second preview.

gábor hojtsy’s picture

Store the file on preview?? Why? You are previewing not submitting!

jonbob’s picture

The file should be stored in the temporary directory (as specified by the administrator in the configuration pages) on preview, then moved to the final location or deleted as appropriate.

Kjartan’s picture

Assigned: Unassigned » Kjartan

Its a bug, I'll fix it when I get time to look into it.

Kjartan’s picture

Should be fixed in CVS now.

Anonymous’s picture