Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
node15646-4.png | 12.04 KB | schildi | |
node15646-3.png | 6.72 KB | schildi | |
node15646-2.png | 6.38 KB | schildi | |
node15646-1.png | 21.37 KB | schildi |
Comments
Comment #1
omerida CreditAttribution: omerida commentedsubscribe
Comment #2
masseuro CreditAttribution: masseuro commentedSame bug,
Using upload button, image on disk, after save the image disappears from disk
Comment #3
quicksketchThe 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.