There is a node type containing an imagefield (multiple allowed, see attached image 1) and an ordinary text field (attached image 2, label "Freigabe").
When hitting "return" after editing the content of the text field (see attached image 1+2) the form is re-displayed. The text field shows the new content (image 3) - but the image field is empty (image 4).
But the DB still refers the image and image files still exist at this time.

mysql> select * from files where filepath like '%KStA-20090810-nr183-s32.gif';
+-------+-----+-----------------------------+-----------------------------------+-----------+----------+--------+-----------+
| fid   | uid | filename                    | filepath                          | filemime  | filesize | status | timestamp |
+-------+-----+-----------------------------+-----------------------------------+-----------+----------+--------+-----------+
| 12926 |   4 | KStA-20090810-nr183-s32.gif | files/KStA-20090810-nr183-s32.gif | image/gif |    76909 |      1 |         0 |
+-------+-----+-----------------------------+-----------------------------------+-----------+----------+--------+-----------+
1 row in set (0.03 sec)
find files -name "KStA-20090810*"
imagecache/scale_medium/KStA-20090810-nr183-s32.gif
imagecache/scale_thumbnail/KStA-20090810-nr183-s32.gif
KStA-20090810-nr183-s32.gif

After saving the node the image including all uploaded image files is completely deleted.

mysql> select * from files where filepath like '%KStA-20090810-nr183-s32.gif';
Empty set (0.03 sec)

CCK-version: 6.x-2.9
Download method: private

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

omerida’s picture

subscribe

masseuro’s picture

Priority: Normal » Major

Same bug,

Using upload button, image on disk, after save the image disappears from disk

quicksketch’s picture

Title: Imagefield: Image lost » Imagefield: Image lost when hitting the "return" key
Category: bug » support
Priority: Major » Normal

When hitting "return" after editing the content of the text field (see attached image 1+2) the form is re-displayed. The text field shows the new content (image 3) - but the image field is empty (image 4).

The behavior of the "return" key varies depending on what other elements there are in the form. In most browsers, hitting the return key will click the *first* submit button in the form. So whichever button is first in the form is probably at fault for wiping out the image field. Note that it's entirely possible that the "Remove" button next to the file you just uploaded is the first button in the form, so hitting the return key clicks it and removes the file.

To solve this problem, I'd suggest either adding JS to the page to surpress the normal behavior of the Return key, or try restructuring your form (perhaps with theming) so that a more valid button exists at the start of the form.