diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/EntityType.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/EntityType.php index 09bfc68..e16d06e 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/EntityType.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/EntityType.php @@ -2,7 +2,7 @@ /** * @file - * Definition of views_handler_filter_entity_bundle + * Definition of \Drupal\views\Plugin\views\filter\EntityType. */ namespace Drupal\views\Plugin\views\filter; @@ -29,14 +29,14 @@ class EntityType extends InOperator { * * @var string */ - public $entityType; + protected public $entityType; /** * The entity info for the entity type. * * @var array */ - public $entityInfo; + protected public $entityInfo; /** * Overrides \Drupal\views\Plugin\views\filter\InOperator::init(). @@ -44,15 +44,7 @@ class EntityType extends InOperator { public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); - // Set the entity type from the definition data, if it's there. - if (isset($this->definition['entity_type'])) { - $this->entityType = $this->definition['entity_type']; - } - // Otherwise, get this from table data. - else { - $this->entityType = $this->getEntityType(); - } - + $this->entityType = $this->getEntityType(); $this->entityInfo = entity_get_info($this->entityType); $this->real_field = $this->entityInfo['bundle keys']['bundle']; } @@ -67,8 +59,9 @@ public function get_value_options() { $options = array(); foreach ($types as $type => $info) { - $options[$type] = t($info['label']); + $options[$type] = $info['label']; } + asort($options); $this->value_options = $options; } @@ -78,6 +71,7 @@ public function get_value_options() { * Overrides \Drupal\views\Plugin\views\filter\InOperator::query(). */ public function query() { + // Make sure that the entity base table is in the query. $this->ensureMyTable(); parent::query(); }