Views' User Name exposed group filter validation

Created on 31 October 2017, over 7 years ago
Updated 16 December 2024, 4 months ago

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 πŸ› Grouped exposed taxonomy filter fails validation for autocomplete widget Needs work . 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

  1. Install Drupal with "Standard" profile
  2. Open content view (/admin/structure/views/view/content)
  3. Add an exposed grouped filter by "Authored by" (User). Make sure the group item is using autocomplete widget
  4. Add at least one item to the group configuration (e.g. "admin")
  5. Submit

Proposed resolution

Apply the same fix and test coverage as in πŸ› Grouped exposed taxonomy filter fails validation for autocomplete widget Needs work . Also, make additional fixes to let tests pass.

Remaining tasks

Review, commit.

There are no User interface, API or Data model changes.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡ΊπŸ‡ΈUnited States grathbone

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024