diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index 74f3b1f..940a202 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -553,7 +553,7 @@ function comment_views_data_alter(&$data) { /** * Implements hook_views_plugins_row_alter(). * - * Removes the comment row plugin provided by the generic row plugin. + * Replaces the generic row plugin by a custom one for nodes. * * @see \Drupal\views\Plugin\views\row\EntityRow */ diff --git a/core/modules/node/node.views.inc b/core/modules/node/node.views.inc index 2af01f0..ff6c7b3 100644 --- a/core/modules/node/node.views.inc +++ b/core/modules/node/node.views.inc @@ -696,7 +696,7 @@ function node_views_wizard() { /** * Implements hook_views_plugins_row_alter(). * - * Removes the node row plugin provided by the generic row plugin. + * Replaces the generic row plugin by a custom one for nodes. * * @see \Drupal\views\Plugin\views\row\EntityRow */ diff --git a/core/modules/user/user.views.inc b/core/modules/user/user.views.inc index f3fdfaf..83942f5 100644 --- a/core/modules/user/user.views.inc +++ b/core/modules/user/user.views.inc @@ -389,10 +389,10 @@ function user_views_query_substitutions($view) { /** * Implements hook_views_plugins_row_alter(). * - * Removes the user row plugin provided by the generic row plugin. + * Replaces the generic row plugin by a custom one for users. * * @see \Drupal\views\Plugin\views\row\EntityRow */ function user_views_plugins_row_alter(&$data) { - unset($data['entity:user']); + $data['entity:user']['class'] = 'Drupal\user\Plugin\views\row\UserRow'; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsEntityRow.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsEntityRow.php index 7a0d8df..30de3bb 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsEntityRow.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsEntityRow.php @@ -41,12 +41,13 @@ public function getDerivativeDefinition($derivative_id, array $base_plugin_defin * Implements \Drupal\Component\Plugin\Derivative\DerivativeInterface::getDerivativeDefinitions(). */ public function getDerivativeDefinitions(array $base_plugin_definition) { - $entity_types = entity_get_info(); - $this->derivatives = array(); - foreach ($entity_types as $entity_type => $entity_info) { + $drupal_container = drupal_container(); + $entity_types = $drupal_container->get('plugin.manager.entity')->getDefinitions(); + $views_data = $drupal_container->get('views.views_data'); + foreach ($entity_types as $entity_type => $entity_info) { // Just add support for entity types which have a views integration. - if (isset($entity_info['base_table']) && drupal_container()->get('views.views_data')->get($entity_info['base_table'])) { + if (isset($entity_info['base_table']) && $views_data->get($entity_info['base_table'])) { $this->derivatives[$entity_type] = array( 'id' => 'entity:' . $entity_type, 'module' => 'views', diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php index bd18387..89af6da 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/RowEntityTest.php @@ -42,7 +42,8 @@ public static function getInfo() { * Tests the area handler. */ public function testEntityArea() { - // @todo The entity_test entity isn't rendered so let's use taxonomy term. + // @todo Replaces the taxonomy term used here with the entity_test entity + // once it can be rendered. $term = entity_create('taxonomy_term', array('name' => $this->randomName())); $term->save();