When a user edits a node which has a previously uploaded image, and uploads a new image, the old revision loses its attached image (image file still exists in the directory but "files" table entry is deleted).

Normally, it is extected that both versions should have their own images. But in this case, only the new version has an image attached to it. This is critical because if you do not accept the new revision, you'll have to reupload the old image again.

How to reproduce:
Add an imagefield to an existing node type. This node type must have the setting "create revisions". Then create a node of this type, and upload an image. Edit the newly created node, and upload another image. The file entry for the old revision will be deleted from the files table and old revision won't have any images attached to it anymore.

CCK version: 5.x-1.6-1
imagefield version: 5.x-2.0-rc2
download method (public or private files): public

Comments

sprater’s picture

I think this is the expected behavior, but its certainly counter-intuitive. I guess the logic here is that you wind up with a lot of files that aren't REALLY attached to any node, and that even if you did go in through FTP to delete them, that there would be a lot of entries in the files table that pointed to files that didn't exist.

drupaloSa’s picture

I think the files table entry should be deleted when the revision is deleted, not when a new revision is created. I'm using a wiki functionality where every user can edit nodes, hence this is an important problem for me. Any suggestions?

greggles’s picture

I think that's a problem with the file module in Drupal core and, unfortunately, I'm not sure that it can be fixed in imagefield.

greggles’s picture

By "file module" I of course mean core file handling in general.

greggles’s picture

Well, I just did some testing with the core upload module (should have done that first) and file revisions worked fine there.

That said, I'm not sure whether "support for revisions" is a feature or a bug or should be a configurable feature since, as you state, keeping all revisions of images could get large.

drupaloSa’s picture

I think this should be defined as a bug since noone working with revisions would want to lose content of the previous versions. This is why they keep revisions, right?

Mark Theunissen’s picture

+1 as a bug: I agree with drupaloSa, I would expect the entire node to be reverted to it's previous state without having to manually repeat steps like uploading images.

dopry’s picture

Status: Active » Fixed

I've added revision support in DRUPAL-5--2 as of rev 1.30.2.6.2.52, please test and file bug as new issues. Please include very detailed instructions for reproducing your revision errors.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.