diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/Entity.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/Entity.php index e6af304..c410e92 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/Entity.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/Entity.php @@ -18,7 +18,8 @@ * @ingroup views_area_handlers * * @Plugin( - * id = "entity" + * id = "entity", + * module = "views" * ) */ class Entity extends AreaPluginBase { @@ -31,20 +32,11 @@ class Entity extends AreaPluginBase { protected $entityType; /** - * Contains the entity info of the entity type of this row plugin instance. - * - * @see entity_get_info() - */ - protected $entityInfo; - - /** * Overrides \Drupal\views\Plugin\views\area\AreaPluginBase::init(). */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); $this->entityType = $this->definition['entity_type']; - - $this->entityInfo = entity_get_info($this->entityType); } /** @@ -90,12 +82,7 @@ public function buildOptionsForm(&$form, &$form_state) { * All view modes of the entity type. */ protected function buildViewModeOptions() { - $options = array(); - if (!empty($this->entityInfo['view_modes'])) { - foreach ($this->entityInfo['view_modes'] as $mode => $settings) { - $options[$mode] = $settings['label']; - } - } + $options = entity_get_view_modes($this->entityType); return $options; } diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php index 981ea42..b5dc005 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaEntityTest.php @@ -78,7 +78,8 @@ public function testEntityAreaData() { */ public function testEntityArea() { $random_label = $this->randomName(); - $entity_test = $this->container->get('plugin.manager.entity')->getStorageController('entity_test_render')->create(array('bundle' => 'entity_test_render', 'name' => $random_label)); + $data = array('bundle' => 'entity_test_render', 'name' => $random_label); + $entity_test = $this->container->get('plugin.manager.entity')->getStorageController('entity_test_render')->create($data); $entity_test->save(); $view = views_get_view('test_entity_area');