I've been searching the queue a bit, but I don't think this one is related to #1038316: Allow for deletion of a single value of a multiple value field. This is my use case:

  • a single text field
  • an image field set to unlimited
  • The collection is using the embed widget in a node bundle

Now, create a node and adding one collection item with one title and multiple images. After that, edit the node and remove one image of the collection item. All images will be gone now - reloading the edit page brings them back of course, but saving the node removes all images.

I've tested it with an image field not being in a collection and then the behavior or removing one single image file works normal.

Now, the remove button is provided by the file module, so I'm not even sure whether we can fix this all together or not, unless maybe with a new process function after.

I'll do some tests tonight to see if I can come up with anything.

Comments

swentel’s picture

Ok, it looks like *maybe* field_collection_field_widget_embed_validate() might be doing something too much / or too little here. Commenting that function out makes the behavior work while editing, however saving an embedded field collection will lose all data, which is not that good of course ;)

/me goes on further bughunting.

thirdboxcar’s picture

+1! Same problem here, just discovered today.

I have a duplicatable group with one text field and one image field set to unlimited. Removing one image removes them all. Luckily, we were removing all the images on this node anyway, but it would be good to have it function as expected.

PS - this is one of the most invaluable modules I've come across so far. Kudos to you for creating it!

swentel’s picture

In the meantime, I quickly wrote http://drupal.org/project/files_undo_remove - it uses javascript to create an undo button and only remove the files on saving a form.

thirdboxcar’s picture

Thank you for this! It works perfectly, even if it is just an interim solution. Your hard work is much appreciated.

labor b’s picture

Thanks swentel, works like a charm when editing a node.
Unfortunately it doesn't work when creating one. Clicking on "remove" just reloads the page.

swentel’s picture

@laborb: interesting, haven't tested that actually, could you open up an issue in that queue so I don't forget looking at it ?

labor b’s picture

Hydra’s picture

Can confirm, that this issue is still active! swentel's Solution from #3 is working for the meanwhile, thanks!

Blue’s picture

Assigned: Unassigned » Blue

I confirm! The bug is still active and is very irritating.

Fidelix’s picture

@Blue, will you fix it?

DuaelFr’s picture

This bug is still there in the lastest dev version.
However, swentel's module (#3) is really great and bypass the issue in a pretty and ergonomic way.

quasi’s picture

Having the same problem.

RobW’s picture

Assigned: Blue » Unassigned

Moving back to Unassigned since Blue hasn't replied, so that other people/maintainers look at this when scanning the issue queue. A pretty major bug if clients are working with images.

jmuzz’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

I tested this with a clean installation and found that removing an image in a field collection did not also remove other images from it in the embedded form.

If it's still happening please reopen with more specific steps to reproduce.