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
Comment #1
swentel CreditAttribution: swentel commentedOk, 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.
Comment #2
thirdboxcar CreditAttribution: thirdboxcar commented+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!
Comment #3
swentel CreditAttribution: swentel commentedIn 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.
Comment #4
thirdboxcar CreditAttribution: thirdboxcar commentedThank you for this! It works perfectly, even if it is just an interim solution. Your hard work is much appreciated.
Comment #5
labor b CreditAttribution: labor b commentedThanks swentel, works like a charm when editing a node.
Unfortunately it doesn't work when creating one. Clicking on "remove" just reloads the page.
Comment #6
swentel CreditAttribution: swentel commented@laborb: interesting, haven't tested that actually, could you open up an issue in that queue so I don't forget looking at it ?
Comment #7
labor b CreditAttribution: labor b commentedI opened an issue: http://drupal.org/node/1370396
Comment #8
Hydra CreditAttribution: Hydra commentedCan confirm, that this issue is still active! swentel's Solution from #3 is working for the meanwhile, thanks!
Comment #9
Blue CreditAttribution: Blue commentedI confirm! The bug is still active and is very irritating.
Comment #10
Fidelix CreditAttribution: Fidelix commented@Blue, will you fix it?
Comment #11
DuaelFrThis 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.
Comment #12
quasi CreditAttribution: quasi commentedHaving the same problem.
Comment #13
RobW CreditAttribution: RobW commentedMoving 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.
Comment #14
jmuzz CreditAttribution: jmuzz commentedI 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.