Commit a03a23b2 authored by catch's avatar catch

Issue #2732091 by damiankloip: Boolean exposed filter value widget just shows 'True' label

parent 22c915f3
......@@ -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])) {
......
......@@ -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'];
}
......
......@@ -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'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment