diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index 16eadd8..1259a01 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -288,11 +288,11 @@ function forum_node_validate(EntityInterface $node, $form) {
       foreach ($node->taxonomy_forums[$langcode] as $delta => $item) {
         // If no term was selected (e.g. when no terms exist yet), remove the
         // item.
-        if (empty($item['tid'])) {
+        if (empty($item['target_id'])) {
           unset($node->taxonomy_forums[$langcode][$delta]);
           continue;
         }
-        $term = taxonomy_term_load($item['tid']);
+        $term = taxonomy_term_load($item['target_id']);
         if (!$term) {
           form_set_error('taxonomy_forums', t('Select a forum.'));
           continue;
@@ -321,11 +321,11 @@ function forum_node_presave(EntityInterface $node) {
     reset($node->taxonomy_forums);
     $langcode = key($node->taxonomy_forums);
     if (!empty($node->taxonomy_forums[$langcode])) {
-      $node->forum_tid = $node->taxonomy_forums[$langcode][0]['tid'];
+      $node->forum_tid = $node->taxonomy_forums[$langcode][0]['target_id'];
       $old_tid = db_query_range("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = :nid ORDER BY f.vid DESC", 0, 1, array(':nid' => $node->nid))->fetchField();
       if ($old_tid && isset($node->forum_tid) && ($node->forum_tid != $old_tid) && !empty($node->shadow)) {
         // A shadow copy needs to be created. Retain new term and add old term.
-        $node->taxonomy_forums[$langcode][] = array('tid' => $old_tid);
+        $node->taxonomy_forums[$langcode][] = array('target_id' => $old_tid);
       }
     }
   }
@@ -523,7 +523,7 @@ function forum_field_storage_pre_insert(EntityInterface $entity, &$skip_fields)
       $query->values(array(
         'nid' => $entity->id(),
         'title' => $translation->title->value,
-        'tid' => $translation->taxonomy_forums->tid,
+        'tid' => $translation->taxonomy_forums->target_id,
         'sticky' => $entity->sticky,
         'created' => $entity->created,
         'comment_count' => 0,
@@ -558,7 +558,7 @@ function forum_field_storage_pre_update(EntityInterface $entity, &$skip_fields)
           $query->values(array(
             'nid' => $entity->nid,
             'title' => $entity->title,
-            'tid' => $item['tid'],
+            'tid' => $item['target_id'],
             'sticky' => $entity->sticky,
             'created' => $entity->created,
             'comment_count' => 0,
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index c08ce70..c711879 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -525,7 +525,7 @@ function createForumTopic($forum, $container = FALSE) {
     // Retrieve node object, ensure that the topic was created and in the proper forum.
     $node = $this->drupalGetNodeByTitle($title);
     $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title)));
-    $this->assertEqual($node->taxonomy_forums[LANGUAGE_NOT_SPECIFIED][0]['tid'], $tid, 'Saved forum topic was in the expected forum');
+    $this->assertEqual($node->taxonomy_forums[LANGUAGE_NOT_SPECIFIED][0]['target_id'], $tid, 'Saved forum topic was in the expected forum');
 
     // View forum topic.
     $this->drupalGet('node/' . $node->nid);
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
index a9ae1c3..4d75105 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessPagerTest.php
@@ -86,7 +86,7 @@ public function testForumPager() {
         'nid' => NULL,
         'type' => 'forum',
         'taxonomy_forums' => array(
-          array('tid' => $tid)
+          array('target_id' => $tid),
         ),
       ));
     }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php
index 434311c..ba3f6b0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php
@@ -111,7 +111,7 @@ public function setUp() {
       $entity->name->value = $this->randomName();
       $index = $i ? 1 : 0;
       $entity->user_id->target_id = $this->accounts[$index]->uid;
-      $entity->{$this->fieldName}->tid = $this->terms[$index]->tid;
+      $entity->{$this->fieldName}->target_id = $this->terms[$index]->tid;
       $entity->save();
       $this->entities[] = $entity;
     }
@@ -153,7 +153,7 @@ public function testQuery() {
     // This returns the 0th entity as that's only one pointing to the 0th
     // term (test with specifying the column name).
     $this->queryResults = $this->factory->get('entity_test')
-      ->condition("$this->fieldName.tid.entity.name", $this->terms[0]->name)
+      ->condition("$this->fieldName.target_id.entity.name", $this->terms[0]->name)
       ->execute();
     $this->assertResults(array(0));
     // This returns the 1st and 2nd entity as those point to the 1st term.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
index 1f0f2ee..f18dd2f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/EntityFilteringThemeTest.php
@@ -102,7 +102,7 @@ function setUp() {
       'title' => $this->xss_label,
       'type' => 'article',
       'promote' => NODE_PROMOTED,
-      'field_tags' => array(array('tid' => $this->term->tid)),
+      'field_tags' => array(array('target_id' => $this->term->tid)),
     ));
 
     // Create a test comment on the test node.
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php
index 3457126..27d41d9 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/field/widget/TaxonomyAutocompleteWidget.php
@@ -52,7 +52,7 @@ public function formElement(array $items, $delta, array $element, $langcode, arr
 
     $tags = array();
     foreach ($items as $item) {
-      $tags[$item['tid']] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['tid']);
+      $tags[$item['target_id']] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['target_id']);
     }
     $element += array(
       '#type' => 'textfield',
@@ -89,7 +89,7 @@ public function massageFormValues(array $values, array $form, array &$form_state
       // otherwise, create a new 'autocreate' term for insert/update.
       if ($possibilities = entity_load_multiple_by_properties('taxonomy_term', array('name' => trim($value), 'vid' => array_keys($vocabularies)))) {
         $term = array_pop($possibilities);
-        $item = array('tid' => $term->tid);
+        $item = array('target_id' => $term->tid);
       }
       else {
         $vocabulary = reset($vocabularies);
@@ -97,7 +97,7 @@ public function massageFormValues(array $values, array $form, array &$form_state
           'vid' => $vocabulary->id(),
           'name' => $value,
         ));
-        $item = array('tid' => FALSE, 'entity' => $term);
+        $item = array('target_id' => FALSE, 'entity' => $term);
       }
       $items[] = $item;
     }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php
index ea9bc3e..65ef536 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TaxonomyTermReferenceItemTest.php
@@ -80,14 +80,14 @@ public function testTaxonomyTermReferenceItem() {
     $tid = $this->term->id();
     // Just being able to create the entity like this verifies a lot of code.
     $entity = entity_create('entity_test', array());
-    $entity->field_test_taxonomy->tid = $this->term->tid;
+    $entity->field_test_taxonomy->target_id = $this->term->tid;
     $entity->name->value = $this->randomName();
     $entity->save();
 
     $entity = entity_load('entity_test', $entity->id());
     $this->assertTrue($entity->field_test_taxonomy instanceof FieldInterface, 'Field implements interface.');
     $this->assertTrue($entity->field_test_taxonomy[0] instanceof FieldItemInterface, 'Field item implements interface.');
-    $this->assertEqual($entity->field_test_taxonomy->tid, $this->term->tid);
+    $this->assertEqual($entity->field_test_taxonomy->target_id, $this->term->tid);
     $this->assertEqual($entity->field_test_taxonomy->entity->name, $this->term->name);
     $this->assertEqual($entity->field_test_taxonomy->entity->id(), $tid);
     $this->assertEqual($entity->field_test_taxonomy->entity->uuid(), $this->term->uuid());
@@ -108,7 +108,7 @@ public function testTaxonomyTermReferenceItem() {
     ));
     $term2->save();
 
-    $entity->field_test_taxonomy->tid = $term2->tid;
+    $entity->field_test_taxonomy->target_id = $term2->tid;
     $this->assertEqual($entity->field_test_taxonomy->entity->id(), $term2->tid);
     $this->assertEqual($entity->field_test_taxonomy->entity->name, $term2->name);
   }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
index d5de5fa..dda6c2f 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
@@ -78,7 +78,7 @@ function testTaxonomyTermFieldValidation() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $entity = field_test_create_entity();
     $term = $this->createTerm($this->vocabulary);
-    $entity->{$this->field_name}[$langcode][0]['tid'] = $term->tid;
+    $entity->{$this->field_name}[$langcode][0]['target_id'] = $term->tid;
     try {
       field_attach_validate($entity);
       $this->pass('Correct term does not cause validation error.');
@@ -89,7 +89,7 @@ function testTaxonomyTermFieldValidation() {
 
     $entity = field_test_create_entity();
     $bad_term = $this->createTerm($this->createVocabulary());
-    $entity->{$this->field_name}[$langcode][0]['tid'] = $bad_term->tid;
+    $entity->{$this->field_name}[$langcode][0]['target_id'] = $bad_term->tid;
     try {
       field_attach_validate($entity);
       $this->fail('Wrong term causes validation error.');
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
index f9cba0d..9b748a0 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermIndexTest.php
@@ -169,7 +169,7 @@ function testTaxonomyIndex() {
     $this->assertEqual(1, $index_count, 'Term 2 is indexed once.');
 
     // Update the article to change one term.
-    $node->{$this->field_name_1}[$langcode] = array(array('tid' => $term_1->tid));
+    $node->{$this->field_name_1}[$langcode] = array(array('target_id' => $term_1->tid));
     $node->save();
 
     // Check that both terms are indexed.
@@ -185,7 +185,7 @@ function testTaxonomyIndex() {
     $this->assertEqual(1, $index_count, 'Term 2 is indexed.');
 
     // Update the article to change another term.
-    $node->{$this->field_name_2}[$langcode] = array(array('tid' => $term_1->tid));
+    $node->{$this->field_name_2}[$langcode] = array(array('target_id' => $term_1->tid));
     $node->save();
 
     // Check that only one term is indexed.
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php
index 5f98990..22d6b10 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php
@@ -54,8 +54,8 @@ function setUp() {
 
     $node = array();
     $node['type'] = 'article';
-    $node['field_views_testing_tags'][]['tid'] = $this->term1->tid;
-    $node['field_views_testing_tags'][]['tid'] = $this->term2->tid;
+    $node['field_views_testing_tags'][]['target_id'] = $this->term1->tid;
+    $node['field_views_testing_tags'][]['target_id'] = $this->term2->tid;
     $this->nodes[] = $this->drupalCreateNode($node);
     $this->nodes[] = $this->drupalCreateNode($node);
   }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php
index 7f7ab02..b536354 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Type/TaxonomyTermReferenceItem.php
@@ -7,12 +7,12 @@
 
 namespace Drupal\taxonomy\Type;
 
-use Drupal\Core\Entity\Field\FieldItemBase;
+use Drupal\Core\Entity\Field\Type\EntityReferenceItem;
 
 /**
  * Defines the 'taxonomy_term_reference' entity field item.
  */
-class TaxonomyTermReferenceItem extends FieldItemBase {
+class TaxonomyTermReferenceItem extends EntityReferenceItem {
 
   /**
    * Property definitions of the contained properties.
@@ -27,52 +27,7 @@ class TaxonomyTermReferenceItem extends FieldItemBase {
    * Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinitions().
    */
   public function getPropertyDefinitions() {
-    if (!isset(static::$propertyDefinitions)) {
-      static::$propertyDefinitions['tid'] = array(
-        'type' => 'integer',
-        'label' => t('Referenced taxonomy term id.'),
-      );
-      static::$propertyDefinitions['entity'] = array(
-        'type' => 'entity',
-        'constraints' => array(
-          'EntityType' => 'taxonomy_term',
-        ),
-        'label' => t('Term'),
-        'description' => t('The referenced taxonomy term'),
-        // The entity object is computed out of the tid.
-        'computed' => TRUE,
-        'read-only' => FALSE,
-        'settings' => array('id source' => 'tid'),
-      );
-    }
-    return static::$propertyDefinitions;
+    $this->definition['settings']['target_type'] = 'taxonomy_term';
+    return parent::getPropertyDefinitions();
   }
-
-  /**
-   * Overrides \Drupal\Core\Entity\Field\FieldItemBase::setValue().
-   */
-  public function setValue($values) {
-    // Treat the values as property value of the entity field, if no array
-    // is given.
-    if (!is_array($values)) {
-      $values = array('entity' => $values);
-    }
-
-    // Entity is computed out of the ID, so we only need to update the ID. Only
-    // set the entity field if no ID is given.
-    if (isset($values['tid'])) {
-      $this->properties['tid']->setValue($values['tid']);
-    }
-    elseif (isset($values['entity'])) {
-      $this->properties['entity']->setValue($values['entity']);
-    }
-    else {
-      $this->properties['entity']->setValue(NULL);
-    }
-    unset($values['entity'], $values['tid']);
-    if ($values) {
-      throw new \InvalidArgumentException('Property ' . key($values) . ' is unknown.');
-    }
-  }
-
 }
diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install
index fef48fb..3daa490 100644
--- a/core/modules/taxonomy/taxonomy.install
+++ b/core/modules/taxonomy/taxonomy.install
@@ -175,19 +175,19 @@ function taxonomy_schema() {
 function taxonomy_field_schema($field) {
   return array(
     'columns' => array(
-      'tid' => array(
+      'target_id' => array(
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => FALSE,
       ),
     ),
     'indexes' => array(
-      'tid' => array('tid'),
+      'target_id' => array('target_id'),
     ),
     'foreign keys' => array(
-      'tid' => array(
+      'target_id' => array(
         'table' => 'taxonomy_term_data',
-        'columns' => array('tid' => 'tid'),
+        'columns' => array('target_id' => 'tid'),
       ),
     ),
   );
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 43d2ac8..ef9cd69 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -1019,8 +1019,8 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
   // Build an array of existing term IDs so they can be loaded with
   // taxonomy_term_load_multiple();
   foreach ($items as $delta => $item) {
-    if (!empty($item['tid']) && $item['tid'] != 'autocreate') {
-      $tids[] = $item['tid'];
+    if (!empty($item['target_id']) && $item['target_id'] != 'autocreate') {
+      $tids[] = $item['target_id'];
     }
   }
   if (!empty($tids)) {
@@ -1030,12 +1030,12 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
     // allowed values for this field.
     foreach ($items as $delta => $item) {
       $validate = TRUE;
-      if (!empty($item['tid']) && $item['tid'] != 'autocreate') {
+      if (!empty($item['target_id']) && $item['target_id'] != 'autocreate') {
         $validate = FALSE;
         foreach ($field['settings']['allowed_values'] as $settings) {
           // If no parent is specified, check if the term is in the vocabulary.
           if (isset($settings['vocabulary']) && empty($settings['parent'])) {
-            if ($settings['vocabulary'] == $terms[$item['tid']]->bundle()) {
+            if ($settings['vocabulary'] == $terms[$item['target_id']]->bundle()) {
               $validate = TRUE;
               break;
             }
@@ -1043,7 +1043,7 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
           // If a parent is specified, then to validate it must appear in the
           // array returned by taxonomy_term_load_parents_all().
           elseif (!empty($settings['parent'])) {
-            $ancestors = taxonomy_term_load_parents_all($item['tid']);
+            $ancestors = taxonomy_term_load_parents_all($item['target_id']);
             foreach ($ancestors as $ancestor) {
               if ($ancestor->tid == $settings['parent']) {
                 $validate = TRUE;
@@ -1067,7 +1067,7 @@ function taxonomy_field_validate(EntityInterface $entity = NULL, $field, $instan
  * Implements hook_field_is_empty().
  */
 function taxonomy_field_is_empty($item, $field) {
-  return !is_array($item) || (empty($item['tid']) && empty($item['entity']));
+  return !is_array($item) || (empty($item['target_id']) && empty($item['entity']));
 }
 
 /**
@@ -1102,7 +1102,7 @@ function taxonomy_field_formatter_view(EntityInterface $entity, $field, $instanc
   switch ($display['type']) {
     case 'taxonomy_term_reference_link':
       foreach ($items as $delta => $item) {
-        if ($item['tid'] == 'autocreate') {
+        if ($item['target_id'] == 'autocreate') {
           $element[$delta] = array(
             '#markup' => check_plain($item['name']),
           );
@@ -1122,7 +1122,7 @@ function taxonomy_field_formatter_view(EntityInterface $entity, $field, $instanc
 
     case 'taxonomy_term_reference_plain':
       foreach ($items as $delta => $item) {
-        $name = ($item['tid'] != 'autocreate' ? $item['entity']->label() : $item['name']);
+        $name = ($item['target_id'] != 'autocreate' ? $item['entity']->label() : $item['name']);
         $element[$delta] = array(
           '#markup' => check_plain($name),
         );
@@ -1133,9 +1133,9 @@ function taxonomy_field_formatter_view(EntityInterface $entity, $field, $instanc
       foreach ($items as $delta => $item) {
         $entity->rss_elements[] = array(
           'key' => 'category',
-          'value' => $item['tid'] != 'autocreate' ? $item['entity']->label() : $item['name'],
+          'value' => $item['target_id'] != 'autocreate' ? $item['entity']->label() : $item['name'],
           'attributes' => array(
-            'domain' => $item['tid'] != 'autocreate' ? url('taxonomy/term/' . $item['tid'], array('absolute' => TRUE)) : '',
+            'domain' => $item['target_id'] != 'autocreate' ? url('taxonomy/term/' . $item['target_id'], array('absolute' => TRUE)) : '',
           ),
         );
       }
@@ -1188,8 +1188,8 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field,
   foreach ($entities as $id => $entity) {
     foreach ($items[$id] as $delta => $item) {
       // Force the array key to prevent duplicates.
-      if ($item['tid'] != 'autocreate' && $item['tid'] !== FALSE) {
-        $tids[$item['tid']] = $item['tid'];
+      if ($item['target_id'] != 'autocreate' && $item['target_id'] !== FALSE) {
+        $tids[$item['target_id']] = $item['target_id'];
       }
     }
   }
@@ -1202,12 +1202,12 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field,
 
       foreach ($items[$id] as $delta => $item) {
         // Check whether the taxonomy term field instance value could be loaded.
-        if (isset($terms[$item['tid']])) {
+        if (isset($terms[$item['target_id']])) {
           // Replace the instance value with the term data.
-          $items[$id][$delta]['entity'] = $terms[$item['tid']];
+          $items[$id][$delta]['entity'] = $terms[$item['target_id']];
         }
         // Terms to be created are not in $terms, but are still legitimate.
-        elseif ($item['tid'] == 'autocreate') {
+        elseif ($item['target_id'] == 'autocreate') {
           // Leave the item in place.
         }
         // Otherwise, unset the instance value, since the term does not exist.
@@ -1354,10 +1354,10 @@ function taxonomy_rdf_mapping() {
  */
 function taxonomy_field_presave(EntityInterface $entity, $field, $instance, $langcode, &$items) {
   foreach ($items as $delta => $item) {
-    if (!$item['tid'] && isset($item['entity'])) {
-      unset($item['tid']);
+    if (!$item['target_id'] && isset($item['entity'])) {
+      unset($item['target_id']);
       taxonomy_term_save($item['entity']);
-      $items[$delta]['tid'] = $item['entity']->tid;
+      $items[$delta]['target_id'] = $item['entity']->tid;
     }
   }
 }
@@ -1417,7 +1417,7 @@ function taxonomy_build_node_index($node) {
         foreach (field_available_languages('node', $field) as $langcode) {
           if (!empty($items[$langcode])) {
             foreach ($items[$langcode] as $item) {
-              $tid_all[$item['tid']] = $item['tid'];
+              $tid_all[$item['target_id']] = $item['target_id'];
             }
           }
         }
diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
index c4f90b8..5cfdcd6 100644
--- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php
@@ -96,7 +96,7 @@ protected function setUp() {
       $term = $this->createTerm($this->vocabulary);
 
       $values = array('created' => $time, 'type' => 'page');
-      $values[$this->field_name][]['tid'] = $term->tid;
+      $values[$this->field_name][]['target_id'] = $term->tid;
 
       // Make every other node promoted.
       if ($i % 2) {
