I setup an image type field with multiple instances on a normal post. I edit that post, and add photos. When I come back to that post, if I click the "Delete (field name)" button it deletes the image file from the website completely.
I want to be able to just remove an image from a post. That way, it will still exist on the website and in the Media Library to be used somewhere else.
I notice when editing the post, if I just erase the text (the URL address of the image) in the field and update the post, that works, but it is not intuitive for my clients.
Thank you for your help.
I see the issue, and I must say I am rather Surprised, as usually, we do not delete Attachments - exactly because they could be used elsewhere!
Now, I see this happens only when the image is attached to ONE Post only, so at least it won't get removed from other posts.
Still, I am rather Surprised about this behaviour, as I share your opinion that it should not happen.
But I can not fix or change this right now. I have to report it to the Developers and ask for a change in the code.
For now, deleting the URL instead of the Repeating Field Instance is the only I can suggest.
In the upcoming release 2.3 this will be adjusted accordingly.
Until then the only way to avoid this is to not delete that image with the Button.
You might add a warning to your Users in the Fields' description.
This is just a notice that Types 2.3 is not yet released.
Right now 2.2.9 has been released.
As such this issue is still present.
Next coming release, Types will not delete any attachments.
If you want to keep deleting the Attachments as the behavior is now, you would use this code in your functions.php:
add_filter( 'wpcf_delete_attachments', '__return_true' );
So, this will be fixed in the next release for you.