diff --git a/core/lib/Drupal/Core/Entity/EntityNG.php b/core/lib/Drupal/Core/Entity/EntityNG.php index 6905b0c..bbc3b84 100644 --- a/core/lib/Drupal/Core/Entity/EntityNG.php +++ b/core/lib/Drupal/Core/Entity/EntityNG.php @@ -387,18 +387,7 @@ public function updateOriginalValues() { foreach ($this->getPropertyDefinitions() as $name => $definition) { if (empty($definition['computed']) && !empty($this->fields[$name])) { foreach ($this->fields[$name] as $langcode => $field) { - // If the value is array we need to filter out potential harmfull - // values like array(0 => NULL) before sending to storage mechanisms - // so that we avoid potential exceptions / empty values stored. - $values = $field->getValue(); - if (is_array($values)) { - foreach($values as $key => $value) { - if ($value === NULL) { - unset($values[$key]); - } - } - } - $this->values[$name][$langcode] = $values; + $this->values[$name][$langcode] = $field->getValue(); } } } diff --git a/core/modules/field_sql_storage/field_sql_storage.module b/core/modules/field_sql_storage/field_sql_storage.module index 3283b26..ea4d35a 100644 --- a/core/modules/field_sql_storage/field_sql_storage.module +++ b/core/modules/field_sql_storage/field_sql_storage.module @@ -484,6 +484,9 @@ function field_sql_storage_field_storage_write(EntityInterface $entity, $op, $fi $items = (array) $entity->{$field_name}[$langcode]; $delta_count = 0; foreach ($items as $delta => $item) { + if ($item === NULL) { + continue; + } // We now know we have someting to insert. $do_insert = TRUE; $record = array(