In a current project we have a node with an image field. This image field is marked as translateble because the alt field of the image should be translated. This means we've set the field to be translateable, but only checked the alt field and not the file field as translatable in the field settings.
This works fine, adding an image will add it to all translations. Replacing the image with a new one replaces it for all translations. Editing the alt text will only change the current translation. All is well.
However, deleting the image in one language will not delete it for all translations. So suddenly they are not synced anymore.
Also, if the client edits the original language that still has the image since it was not deleted, the image will turn up again in the language where it was previously deleted, since adding an image is synced across translations. This seems to me like a bug.
Steps to reproduce
1. Spin up a new Drupal 8.2.3 installation on Simplytest.me
2. Enable the content translation module and Add a new language
4. Go to /admin/config/regional/content-language
5. Check "Content" and check "Article" to enable translation for that node type. Make sure the Image field is checked as translatable but the "File" checkbox is off (it should be by default).
4. Create a new Article node and upload an image
5. Translate the article, (it will have the image populated automatically) and save the translation.
6. Edit the translation and remove the image.
7. Visit the node in the original language.
Expected result
The image is removed in the original language as well.
Actual result
The image is still there. Editing this node and saving it will recreate the image in the translated version.
Comments
Comment #2
reekris commentedComment #3
reekris commentedJust found this issue which could be a duplicate of this one #2428129: Removing shared file from translation does not remove from other language. However it's unclear if the Image field on the article node is set as translatable or not in that issue. When an image field is not set as translatable it will be deleted in all languages, so that case seems to work as intended.
Comment #4
matsbla commentedCan it be related to this #2837023: Image fields that follow core gets broken when set to translatable
Do you get same result with image fields in other content types?
Comment #5
reekris commentedIt seems to be related, although I'm having the same issue with Image fields other than the default one on Article. In a current project I have created an image field on a custom content type and also an image field in a Paragraph entity. They both exhibit the same problem.
These fields were created some time ago though, maybe something has changed in the default configuration since then that makes newly created fields work now. I will try creating a new image field and see if it works.
Comment #19
pameeela commentedDuplicate of #2428129: Removing shared file from translation does not remove from other language which has been closed.