diff -u b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php --- b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php @@ -117,6 +117,10 @@ * Gets the entity labels. */ protected function getLabels(FieldInterface $items) { + if ($items->isEmpty()) { + return array(); + } + $entity_ids = array(); $entity_labels = array(); diff -u b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/widget/TestFieldWidgetMultiple.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/widget/TestFieldWidgetMultiple.php --- b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/widget/TestFieldWidgetMultiple.php +++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/field/widget/TestFieldWidgetMultiple.php @@ -60,8 +60,8 @@ */ public function formElement(FieldInterface $items, $delta, array $element, $langcode, array &$form, array &$form_state) { $values = array(); - foreach ($items as $delta => $value) { - $values[] = $value['value']; + foreach ($items as $delta => $item) { + $values[] = $item->value; } $element += array( '#type' => 'textfield', diff -u b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php --- b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php +++ b/core/modules/file/lib/Drupal/file/Plugin/field/formatter/TableFormatter.php @@ -32,11 +32,11 @@ public function viewElements(EntityInterface $entity, $langcode, FieldInterface $items) { $elements = array(); - if (!empty($items)) { + if (!$items->isEmpty()) { // Display all values in a single element. $elements[0] = array( '#theme' => 'file_formatter_table', - '#items' => $items, + '#items' => $items->getValue(TRUE), ); } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/Field/FieldItemBase.php +++ b/core/lib/Drupal/Core/Entity/Field/FieldItemBase.php @@ -123,6 +123,7 @@ public function __isset($name) { */ public function __unset($name) { $this->set($name, NULL); + unset($this->values[$name]); } /**