diff --git a/core/modules/views/src/Plugin/ViewsHandlerManager.php b/core/modules/views/src/Plugin/ViewsHandlerManager.php index d138d72d054a8782ae762927dbdacc5732e4c820..d918696d67438b50fdd7ffc6d8bf34d544c0bd21 100644 --- a/core/modules/views/src/Plugin/ViewsHandlerManager.php +++ b/core/modules/views/src/Plugin/ViewsHandlerManager.php @@ -86,7 +86,7 @@ public function getHandler($item, $override = NULL) { if (isset($data[$field][$this->handlerType])) { $definition = $data[$field][$this->handlerType]; - foreach (array('group', 'title', 'title short', 'help', 'real field', 'real table', 'entity type', 'entity field') as $key) { + foreach (array('group', 'title', 'title short', 'label', 'help', 'real field', 'real table', 'entity type', 'entity field') as $key) { if (!isset($definition[$key])) { // First check the field level. if (!empty($data[$field][$key])) { diff --git a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php index 616666be43594d555c247998953535a01d809050..7078032e89da4afe4874ee997f23699869088c7c 100644 --- a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php +++ b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php @@ -93,9 +93,14 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o parent::init($view, $display, $options); $this->value_value = $this->t('True'); + if (isset($this->definition['label'])) { $this->value_value = $this->definition['label']; } + elseif (isset($this->definition['title'])) { + $this->value_value = $this->definition['title']; + } + if (isset($this->definition['accept null'])) { $this->accept_null = (bool) $this->definition['accept null']; } diff --git a/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php b/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php index 3faca0c7b12dc8b2d1e77c01860977604dd71515..668cc4c1de1116c5c4ecfbea9a69ddcc8a382289 100644 --- a/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php +++ b/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php @@ -23,6 +23,10 @@ class FilterBooleanWebTest extends UITestBase { public function testFilterBooleanUI() { $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_view/default/filter', array('name[views_test_data.status]' => TRUE), t('Add and configure @handler', array('@handler' => t('filter criteria')))); + // Check the field widget label. 'title' should be used as a fallback. + $result = $this->cssSelect('#edit-options-value--wrapper legend span'); + $this->assertEqual((string) $result[0], 'Status'); + $this->drupalPostForm(NULL, array(), t('Expose filter')); $this->drupalPostForm(NULL, array(), t('Grouped filters'));