Problem/Motivation
Numeric views filter (\Drupal\views\Plugin\views\filter\NumericFilter) and all child filters (Date, SearchApiDate, etc) throw a php notice when using grouped exposed filters with a group identifier that doesn't match the filter identifier.
Notice: Undefined index: value in Drupal\views\Plugin\views\filter\NumericFilter->acceptExposedInput()
Since PHP 8 this is upgraded to an error:
TypeError: Cannot access offset of type string on string in Drupal\views\Plugin\views\filter\Date->acceptExposedInput()
Steps to reproduce
(require updates)
- Install Drupal standard profile
- Edit the default Content view at /admin/structure/views/view/content
- Add a "Changed" filter
- Select "Expose this filter to visitors, to allow them to change it"
- Select "Grouped filters"
- Change the "Filter identifier" to "date"
- Set the Grouping 1 label to "Last week", operator to "Is greater than", value type to "An offset from ..." and value "-7 days"
- Press Apply and then Save
- Navigate to /admin/content
- Set the "Changed" filter to "Last week" and press "Filter".
Proposed resolution
Update \Drupal\views\Plugin\views\filter\NumericFilter::acceptExposedInput to target the exposed group identifier as per patch in #48.
Remaining tasks
- Add an automated test;