Menu Link Content plugin creates invalid entity translations when Babel string translations are deleted
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3578415. -->
Reported by: [huzooka](https://www.drupal.org/user/281301)
Related to !77
>>>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install a standard Drupal, enable Content Translation and Babel Menu Link Content.
<p><code>drush si -y && drush en babel_menu_link_content content_translation -y</code></p></li>
<li>Add a configurable language.
<p><code>drush php:eval "ConfigurableLanguage::createFromLangcode('fr')->save();"</code></p></li>
<li>Log in as admin, and add a new link to the Main navigation at <code>/admin/structure/menu/manage/main</code>. Title: <code>Home page</code>, link: <code><front></code></li>
<li>Visit Babel admin interface, search for "Home page", then translate the string to something, e.g. <code>[FR] Home page</code>. Click the first checkmark icon (save).</li>
<li>Still on Babel admin interface, delete the translation you just created.</li>
<li>Visit <code>/fr/admin/structure/menu/manage/main</code></li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ol>
<li>As I see, the translation deletion mechanism is totally missing.</li>
<li>Don't let the plugin create invalid entities. If a menu link translation is invalid then don't save it. If it is a preexisting translation which just became invalid then delete the translation.</li>
<li>Properly track the source of the translations. Require Content Translation, translatability of menu link content fields and properly fill in content_translation_source and content_translation_created fields at least.</li>
</ol>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p><del>I can see the same pattern at the content entity plugin, let's check that too.</del> Should be done in a separate ticket, <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/babel/-/work_items/3547227" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/babel/-/work_items/3547227</a></span>.</p>
<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