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.
Steps to reproduce:
1. Enable upload module
2. Create a story or whatever
3. Attach a file.
4. Click Save.
5. File is gone; it's not there on node view, nor is it there when you go back and edit the node.
If you preview first and then submit, the file's there.
Comment | File | Size | Author |
---|---|---|---|
#9 | upload_submit.patch | 3.99 KB | chx |
#6 | upload.module_47.patch | 950 bytes | julien |
#4 | upload.module_46.patch | 1.16 KB | fwalch |
Comments
Comment #1
julien CreditAttribution: julien commentedI have reproduce this issue, and i have seen that when you save before the preview, it appears in the table file, but not in the table upload, which is the table used to see the files attachement.
I have insert manualy a record with the fid of the file in the table file, and now it appears.
I'm trying to locate where is the sql query and i will change it when i will find it.
If someone know in which file is this query, it will help me.
Comment #2
Gábor HojtsyOh, this would be great to get fixed in beta 1 indeed.
Comment #3
drewish CreditAttribution: drewish commentedit looks like the root of it is that hook_nodeapi($op='view') is now being called before hook_nodeapi($op='prepare'). prepare is where the files are attached. so if you click preview twice the files are attached properly.
Comment #4
fwalch CreditAttribution: fwalch commentedI found out that if you just save the node, no files are attached to the node object. If you preview first, "_upload_prepare" is called, which attaches the files.
This patch checks if all files are attached to the node and adds missing ones, which fixes the bug.
Comment #5
drewish CreditAttribution: drewish commentedpreviews don't work. you still have to click preview twice.
Comment #6
julien CreditAttribution: julien commentedI have apply the patch 46, and add a line in the case 'view' to prepare the node. It will put the file in the table upload only after clicking on save.
Comment #7
chx CreditAttribution: chx commentedI am on the case. Seems when saving a node form, nodeapi op prepare is not called. WTF?
Comment #8
chx CreditAttribution: chx commentedComment #9
chx CreditAttribution: chx commentedupload_prepare operates on submitted info, that hardly belongs to op prepare. I fixed a few notices as I went. The patch has known issues, on edit I got a surplus line saying "0 1" in the file attachment table, as time permits I will fix that. But essentially this works.
Comment #10
chx CreditAttribution: chx commentedTwin issue was http://drupal.org/node/164674 but as I patched this, that one is now duplicate.
Comment #11
chx CreditAttribution: chx commentedI have just tested the patch and it works. I suspect dvessel's patches...
Comment #12
dvessel CreditAttribution: dvessel commentedchx, I misunderstood.. The patch does indeed work. Got confused by how this issue was progressing so I never applied the patch. duh..
Not related to this, but in Safari 2 clicking the "attach" button shows the progress animation but never finishes. Just clicking save without previews works fine.
Comment #13
Gábor HojtsyOK, committed. Awating patches for the remaining issues.
Comment #14
(not verified) CreditAttribution: commented