I’ve added an image field to the disknode content type to act as a file icon. Now, when I create a new disknode, select a file and upload an icon image, all is fine (apart from the fact that the icon file is shown as a download alongside with the disknode file). But when I edit this disknode, the filename (incl. path) of the icon file gets copied into the ‘file path’ field, which now contains something like this: files/icons/icon.jpg /files/downloads/file.zip. When I now save the node (whether I fixed the file path field or not), the image field loses its image file (icon filename set to “”).
I had a look into disknode.module, but I really don't see the connection between the image field and the file path. Any help is appreciated!
Comments
Comment #1
gmenzel commentedPlease, anyone?
Comment #2
gmenzel commentedIs this project still maintained? It certainly SEEMS to be dead...
Anyway, I now realize that the behavior I described above is consistent with how the disknode module works internally. Temporary fix: 'disknode.inc' lines 263, 267, 291 and 316; adding a WHERE clause which filters the filemime to exclude all 'image/...' types. With this it is of course no longer possible to download image files, but that's fine with me for now.
I would really like to see a real fix for this problem in a future version, should there ever be one.
Comment #3
Ectar commentedI not really following what did you do initially and what is the problem. But I tried to reproduce it:
I've Enabled images for the disknode content type, created node with file and image and everything works fine. First of all my image was not copied anywhere close to my disknode file. All images have own location in my case it is /files/images and all disknode files is in files/downloads
Comment #4
gmenzel commentedHi Ectar!
Well, every disknode searches the 'files' table for entries with the right node id and shows ALL those files as downloads, right? When a field_image_cache is added to the disknode content type, it seems that the content of this field is also stored in the 'files' table - also associated with the node via the node id. Disknode does not distinguish between those entries and just shows them all as downloads.
When editing such a disknode, the 'File path' field gets filled with all these filenames concatenated, which obviously leads to bad results when saving. Also, disknode first deletes all matching entires from 'files' before saving, which explains why the image field loses its image file.
But maybe I'm missing something really obvious here. If so, please let me know.