diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install index 55c225f..61ac2f5 100644 --- a/core/modules/taxonomy/taxonomy.install +++ b/core/modules/taxonomy/taxonomy.install @@ -6,6 +6,7 @@ */ use Drupal\Component\Uuid\Uuid; +use Drupal\field\Plugin\Core\Entity\Field; /** * Implements hook_uninstall(). @@ -356,13 +357,7 @@ function taxonomy_update_8007() { $field_config = config($config_name); // Only update taxonomy reference fields that use the default SQL storage. if ($field_config->get('type') == 'taxonomy_term_reference' && $field_config->get('storage.type') == 'field_sql_storage') { - $field_id = $field_config->get('id'); - $field = array( - // _field_sql_storage_tablename() still relies on the 'field_name' - // property. - 'field_name' => $field_id, - 'deleted' => FALSE, - ); + $field = new Field($field_config->get()); $tables = array( _field_sql_storage_tablename($field), @@ -370,7 +365,7 @@ function taxonomy_update_8007() { ); foreach ($tables as $table_name) { - db_change_field($table_name, $field_id . '_tid', $field_id . '_target_id', array( + db_change_field($table_name, $field->id() . '_tid', $field->id() . '_target_id', array( 'description' => 'The ID of the target entity.', 'type' => 'int', 'unsigned' => TRUE, @@ -378,8 +373,8 @@ function taxonomy_update_8007() { )); // Change the index. - db_drop_index($table_name, $field_id . '_tid'); - db_add_index($table_name, $field_id . '_target_id', array($field_id . '_target_id')); + db_drop_index($table_name, $field->id() . '_tid'); + db_add_index($table_name, $field->id() . '_target_id', array($field->id() . '_target_id')); } }