Skip to content
Snippets Groups Projects

Issue #3176839: Don't add translation, if exist

1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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();
Please register or sign in to reply
Loading