diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index b39ff27..e3c599e 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -37,6 +37,7 @@ * Overrides Entity::__construct(). */ public function __construct(array $values, $entity_type) { + $this->langcode = language_default()->langcode; parent::__construct($values, $entity_type); // Backup the original ID, if any. diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 1d3817a..785c81c 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -27,7 +27,7 @@ class Entity implements IteratorAggregate, EntityInterface { * * @var string */ - public $langcode; + public $langcode = LANGUAGE_NOT_SPECIFIED; /** * The entity type. @@ -68,7 +68,6 @@ class Entity implements IteratorAggregate, EntityInterface { */ public function __construct(array $values, $entity_type) { $this->entityType = $entity_type; - $this->langcode = language_default()->langcode; // Set initial values. foreach ($values as $key => $value) { $this->$key = $value;