diff --git a/core/lib/Drupal/Core/Entity/ContentEntityBase.php b/core/lib/Drupal/Core/Entity/ContentEntityBase.php index aa98a93..929d1b5 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -569,10 +569,10 @@ protected function setDefaultLangcode() { if (\Drupal::moduleHandler()->moduleExists('language')) { $this->defaultLangcode = language_get_default_langcode($this->entityType(), $this->bundle()); } - } - if (empty($this->defaultLangcode)) { - // Make sure we return a proper language object. - $this->defaultLangcode = Language::LANGCODE_NOT_SPECIFIED; + else { + // Make sure we return a proper language object. + $this->defaultLangcode = Language::LANGCODE_NOT_SPECIFIED; + } } // This needs to be initialized manually as it is skipped when instantiating // the language field object to avoid infinite recursion.