Issue #2732091 by damiankloip: Boolean exposed filter value widget just shows 'True' label
parent
22c915f33f
commit
a03a23b21b
|
@ -86,7 +86,7 @@ class ViewsHandlerManager extends DefaultPluginManager implements FallbackPlugin
|
|||
|
||||
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 @@ class BooleanOperator extends FilterPluginBase {
|
|||
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'));
|
||||
|
||||
|
|
Loading…
Reference in New Issue