Entity references are deleted from source if translation fails
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3555741. --> Reported by: [peacog](https://www.drupal.org/user/390819) Related to !988 !3 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>If the translation of a referenced entity fails, the referenced entity is deleted from the parent entity instead of being kept in the original language. </p> <p>I have a content type with paragraph and media fields. If a node has a lot of content to be translated I often exceed OpenAI rate limits and the translation fails with a <code>Error invoking model response: Request rate limit has been exceeded.</code> error. When that happens while processing a paragraph field, the paragraph is deleted from the parent node instead of being retained untranslated.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>In <code>ReferenceFieldExtractor::setValue</code> start with the original values and only set a new translated value if the translation succeeded.</p>
issue