Grouping a date filter results in an undefined index notice:

Notice: Undefined index: #states in Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedFiltersGroupForm() (line 995 of ...\core\modules\views\src\Plugin\views\filter\FilterPluginBase.php).
  1. Install Drupal using the standard profile
  2. Navigate to admin/structure/types/manage/article/fields/add-field
  3. Add a new field of type "Date", label = "Optional date field"
  4. Click Save on the next two pages to accept the default values
  5. Navigate to admin/structure/views/view/frontpage
  6. Add the "field_optional_date_field" filter
  7. Tick the "Expose this filter..." checkbox
  8. (Workaround #2248223: Adding a new Views filter and making it exposed returns user back to list of filters: Click cancel and click the "Optional date field" filter to edit it again)
  9. Tick the "Expose this filter..." checkbox
  10. Tick the "Grouped filters" radio button
  11. Navigate to admin/reports/dblog

Comments

mikeker created an issue. See original summary.

mikeker’s picture

Assigned: mikeker » Unassigned
Status: Active » Needs review
StatusFileSize
new2.71 KB
new3.44 KB

This patch fixes the notices in manual testing, but the simpletest added still fails which makes me think there's some deeper issue here. Post this for now in case someone else wants to take a stab at it.

mikeker’s picture

The last submitted patch, 2: 2637854-2-tests-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 2: 2637854-2-grouped-date-states.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

klabautermann_’s picture

StatusFileSize
new3.37 KB

Combined Patch 2637854-2-grouped-date-states with 2874767_fixed_exposed_date_filter_zero_values_operator.

lendude’s picture

Status: Needs work » Needs review
StatusFileSize
new3.46 KB

This should apply.

Status: Needs review » Needs work

The last submitted patch, 12: 2637854-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

matroskeen’s picture

Adding #2636086: Add extra test coverage for operators of views date filters as a potential duplicate issue. I think I followed similar steps when was working on additional test coverage, and this notice did not appear. I'll double-check before closing it.

Version: 9.2.x-dev » 9.3.x-dev
matroskeen’s picture

Status: Needs work » Closed (cannot reproduce)

I tried again and failed to reproduce this issue following the steps in the IS.

Notice: Undefined index: #states in Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedFiltersGroupForm() (line 995 of 
...\core\modules\views\src\Plugin\views\filter\FilterPluginBase.php).

There is no such line anymore (I couldn't find it in the history either).

Also, it looks like some part of it was fixed in #2865344: Exposed date filters 'empty' and 'not empty' are broken.

I think it's safe to close it as outdated.
Thanks!