diff --git a/core/lib/Drupal/Core/Field/FieldItemBase.php b/core/lib/Drupal/Core/Field/FieldItemBase.php index 5cadca2..b9c90d9 100644 --- a/core/lib/Drupal/Core/Field/FieldItemBase.php +++ b/core/lib/Drupal/Core/Field/FieldItemBase.php @@ -191,7 +191,14 @@ public function __isset($name) { * {@inheritdoc} */ public function __unset($name) { - $this->set($name, NULL); + // Explicitly unset the property in $this->values if a non-defined + // property is unset, such that its key is removed from $this->values. + if (!$this->definition->getPropertyDefinition($name)) { + unset($this->values[$name]); + } + else { + $this->set($name, NULL); + } } /**