ContentEntity plugin can trigger exception if string translation is deleted
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3580045. -->
Reported by: [huzooka](https://www.drupal.org/user/281301)
Related to !79 !78
>>>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>drush si -y && drush en babel_content_entity content_translation -y</li>
<li>drush php:eval "\Drupal\language\Entity\ConfigurableLanguage::createFromLangcode('fr')->save();"</li>
<li>drush php:eval "\Drupal\taxonomy\Entity\Term::create(['name' => 'Foo', 'vid' => 'tags'])->save();"</li>
<li>drush cset babel.settings translation_type "{plugin: {config: [], locale: [], 'content_entity:taxonomy_term': {bundle: [tags]}}}" --input-format=yaml -y</li>
<li>drush uli admin/config/regional/babel/settings/content-entity</li>
<li>Select "Taxonomy term", then save form</li>
<li>Go to admin/config/regional/babel/fr?search=Foo</li>
<li>Disable the browser's JavaScript interpreter.</li>
<li>Translate the string "Foo", hit save.</li>
<li>Delete the translation of "Foo".</li>
</ol>
<p>This is a very similar problem to the one which was reported and fixed in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/babel/-/work_items/3578415" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/babel/-/work_items/3578415</a></span>, but it seems that depending on how precise the entity field definitions are compared to the database storage schema, this doesn't create invalid entity translations; because the (SQL) schema prevents the entities being saved.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Copy and adapt the fix from <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/babel/-/work_items/3578415" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/babel/-/work_items/3578415</a></span>.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ol>
<li>Patch</li>
<li>Test coverage</li>
</ol>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>Nothing.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>Nothing.</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>Nothing.</p>
issue