Disable JS and try to use the upload module

when the "Attach" button is clicked, all form values are lost, and the file is not loaded.

clicking the "Preview" button works. Attached patch just duplicates most of the code from the node preview submit function.

Seems to work, but I really am not sure it's doing the right thing...

CommentFileSizeAuthor
#1 attach_2.patch1.25 KBflk
attach_1.patch1.25 KBpwolanin

Comments

flk’s picture

StatusFileSize
new1.25 KB

i can confirm this solves the problem of form content being cleared when JS is not disabled and one tries to attach a file.
rerolled against HEAD.

flk’s picture

s/JS is not/JS is

pwolanin’s picture

after talking w/ chx in IRC, I think there is a simpler way to do this - just a normal submit function that sets rebuild to TRUE if the op matches the button. Preview is a special case, since the node preview must be built after all the normal submit functions have run.

pwolanin’s picture

hmmm, now form testing I see (and chx tells me) that 'op' is no longer a reliable part of $form_state['values'] for some reason. So, the previous patch may be the best bet for the moment.

chx’s picture

Status: Needs review » Closed (duplicate)

this will be fixed at http://drupal.org/node/160039