Issue #3176839: Don't add translation, if exist
Open
requested to merge issue/default_content-3176839:3176839-dont-add-translation-save-translation into 2.0.x
1 unresolved thread
Merge request reports
Activity
Filter activity
187 187 if (!empty($data['translations'])) { 188 188 foreach ($data['translations'] as $langcode => $translation_data) { 189 189 if ($this->languageManager->getLanguage($langcode)) { 190 $translation = $entity->addTranslation($langcode, $entity->toArray()); 190 if (!$entity->hasTranslation($langcode)) { 191 $translation = $entity->addTranslation($langcode, $entity->toArray()); 192 } 193 else { 194 $translation = $entity->getTranslation($langcode, $entity->toArray()); 195 } 191 196 foreach ($translation_data as $field_name => $values) { 192 197 $this->setFieldValues($translation, $field_name, $values); 193 198 } 199 $translation->save(); Looks like the translation shouldn't be saved here. Importer saves a whole node later - in this way the changes are similar to !6 (diffs).
Please register or sign in to reply