summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2015-01-13 09:17:58 (GMT)
committerAlex Pott2015-01-13 09:17:58 (GMT)
commit315c2a8493562ad5386e169b2cf6c6d34358ce99 (patch)
tree3899a0e464068520d6c7a48b642c1fcaaaab75ff
parentec9a3ec27da1c9f2cb6a4568e8fae5f4b1b54c32 (diff)
Issue #2215473 by Lendude, speely, pjonckiere: Filter description not visible in exposed form
-rw-r--r--core/modules/views/src/Tests/Plugin/ExposedFormTest.php3
-rw-r--r--core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml1
-rw-r--r--core/modules/views/views.theme.inc3
3 files changed, 7 insertions, 0 deletions
diff --git a/core/modules/views/src/Tests/Plugin/ExposedFormTest.php b/core/modules/views/src/Tests/Plugin/ExposedFormTest.php
index c6bc335..ed64ba3 100644
--- a/core/modules/views/src/Tests/Plugin/ExposedFormTest.php
+++ b/core/modules/views/src/Tests/Plugin/ExposedFormTest.php
@@ -137,6 +137,9 @@ class ExposedFormTest extends ViewTestBase {
$expected_action = _url($view->display_handler->getUrl());
$this->assertFieldByXPath('//form/@action', $expected_action, 'The expected value for the action attribute was found.');
+ // Make sure the description is shown.
+ $result = $this->xpath('//form//div[contains(@id, :id) and normalize-space(text())=:description]', array(':id' => 'edit-type--description', ':description' => t('Exposed description')));
+ $this->assertEqual(count($result), 1, 'Filter description was found.');
}
/**
diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml
index f3ec0a9..cc37f74 100644
--- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml
+++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_buttons.yml
@@ -29,6 +29,7 @@ display:
label: 'Content: Type'
operator_id: type_op
reduce: false
+ description: 'Exposed description'
exposed: true
field: type
id: type
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index f969db8..d2e11d3 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -1014,6 +1014,9 @@ function template_preprocess_views_exposed_form(&$variables) {
if (!empty($info['label'])) {
$form[$info['value']]['#title'] = $info['label'];
}
+ if (!empty($info['description'])) {
+ $form[$info['value']]['#description'] = $info['description'];
+ }
}
}