Problem/Motivation
When adding an exposed and grouped user_name filter, the value doesn't validate correctly. It issue stems from the entity reference autocomplete field handling values using the target_id key, and loaded entities.
This is exactly the same issue as reported in #2576927: Grouped exposed taxonomy filter fails validation for autocomplete widget. Please check it out for more details.
Other changes applied in the merge request are just allowed new tests to pass. There were 2 issues:
1) Default value of the filter was trying to be processed twice but failed with the exception. More information is in duplicated issue: #3250352: Username views filter should not process default value twice . Fixed in this commit: https://git.drupalcode.org/project/drupal/-/merge_requests/1445/diffs?co...
2) There was a PHP notice in \Drupal\user\Plugin\views\filter\Name::validateExposed
method, that was fixed in this commit: https://git.drupalcode.org/project/drupal/-/merge_requests/1445/diffs?co...
Steps to reproduce
- Install Drupal with "Standard" profile
- Open content view (/admin/structure/views/view/content)
- Add an exposed grouped filter by "Authored by" (User). Make sure the group item is using autocomplete widget
- Add at least one item to the group configuration (e.g. "admin")
- Submit
Proposed resolution
Apply the same fix and test coverage as in #2576927: Grouped exposed taxonomy filter fails validation for autocomplete widget. Also, make additional fixes to let tests pass.
Remaining tasks
Review, commit.
There are no User interface, API or Data model changes.