Commit 36c53a27 authored by alexpott's avatar alexpott

Issue #2811887 by Lendude, sdstyles, DeFr, louisnagtegaal, d.olaresko,...

Issue #2811887 by Lendude, sdstyles, DeFr, louisnagtegaal, d.olaresko, _Archy_, mpdonadio: Exposed date filter leads to a notice
parent a333b556
......@@ -133,6 +133,11 @@ public function acceptExposedInput($input) {
}
$rc = parent::acceptExposedInput($input);
// Restore what got overwritten by the parent.
if (!is_null($type)) {
$this->value['type'] = $type;
}
// Don't filter if value(s) are empty.
$operators = $this->operators();
if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator_id'])) {
......@@ -153,11 +158,6 @@ public function acceptExposedInput($input) {
}
}
// Restore what got overwritten by the parent.
if (!is_null($type)) {
$this->value['type'] = $type;
}
return $rc;
}
......
......@@ -292,4 +292,22 @@ protected function _testFilterDatetimeUI() {
$this->assertConfigSchemaByName('views.view.test_filter_date_between');
}
/**
* Tests that the exposed date filter is displayed without errors.
*/
public function testExposedFilter() {
$this->drupalLogin($this->drupalCreateUser(['administer views']));
$this->drupalPostForm('admin/structure/views/nojs/handler/test_filter_date_between/default/filter/created', [], t('Expose filter'));
$this->drupalPostForm('admin/structure/views/view/test_filter_date_between/edit', [], t('Add Page'));
$edit = [
'path' => 'exposed-date-filter',
];
$this->drupalPostForm('admin/structure/views/nojs/display/test_filter_date_between/page_1/path', $edit, t('Apply'));
$this->drupalPostForm(NULL, [], t('Save'));
$this->drupalGet('exposed-date-filter');
$this->assertField('created');
}
}
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