Problem/Motivation

The Views setting option for the "Any" value appears to have no effect on the output except for the top row in the grouped exposed filters configuration form.

Screenshot of configuration option in Views settings form

I also don't find any use in the code of that configuration (old_any) except:

  • On the Views settings form (/admin/structure/views/settings)
  • On the grouped exposed filters configuration form.
  • In YAML configuration files.

Here are screenshots of the grouped filters configuration form and the preview of the exposed form, showing where the setting does and doesn't have an effect.

Screenshot of exposed form preview

screenshot of grouped exposed filters form

Steps to reproduce

Proposed resolution

If my understanding of the setting and its lack of effect is correct, remove it.

Remaining tasks

Change record review
Check for uses in contrib
Decide if this should be removed or made configurable, #2156059: Allow the “Any” label to be customised in individual Views Grouped filters

User interface changes

Grouped Filter

Before

After

Settings page

Before

After

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3569063

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kentr created an issue. See original summary.

kentr’s picture

Category: Task » Bug report

Maybe it's really a bug, since the setting doesn't do what it sounds like it's meant to.

chaitanyadessai’s picture

Status: Active » Needs review
StatusFileSize
new5.94 KB

Please review patch.

jesus_md’s picture

StatusFileSize
new21.97 KB
new22.77 KB

Tested the patch in #3 and the code checks out. I agree with the analysis in the summary: nothing else reads ui.exposed_filter_any_label, and the exposed form always renders - Any - because it's hardcoded in the filter handlers. So the setting only ever changed the top row of the grouped filters table in the admin UI.

Before the patch the setting was stored as old_any, the select showed on /admin/structure/views/settings, and the grouped table for the content view's "Published status" filter showed <Any>. After applying it and running drush updb, the post-update removed the key, the select is gone, the settings form still saves without errors, and the grouped table shows - Any -. The new update test, SettingsTest and ExposedFormUITest pass, and phpcs is clean.

Setting to Needs work for a few non-code things:

  • Core patches don't get tested by CI anymore, so this needs to be an MR on the issue fork. The patch applies to current main, with one hunk offset by 71 lines.
  • It removes a config key that contrib could be reading, so it probably needs a change record.
  • The issue summary should fill in "Proposed resolution" and "User interface changes". On sites with the default value the grouped table row goes from <Any> to - Any -, which now matches what visitors see.
  • Minor: #[IgnoreDeprecations] on the new update test doesn't look necessary.

Tested on:

  • Drupal core 11.4.5, patch from #3
  • PHP 8.5.5

Grouped filters table before the patch, showing <Any>

Grouped filters table after the patch, showing - Any -

jesus_md’s picture

Status: Needs review » Needs work
kentr’s picture

Issue tags: +Needs merge request

chaitanyadessai’s picture

Status: Needs work » Needs review

MR raised please review.

amitgoyal’s picture

Status: Needs review » Reviewed & tested by the community

Added a change record for the removed views.settings:ui.exposed_filter_any_label config key: https://www.drupal.org/node/3626113

Reviewed MR !17254:
- Pipeline is green (only allow_failure PHP 8.6-ubuntu next-major jobs failed, unrelated to this change)
- No open review threads
- PHPCS clean on all changed files
- ViewsRemoveExposedFilterAnyLabelUpdateTest, SettingsTest, and ExposedFormUITest all pass locally
- Verified locally: the "Any" select is gone from /admin/structure/views/settings, and the grouped exposed filters table now shows the "- Any -" label instead of the old bracketed label

Moving to RTBC.

quietone’s picture

Issue summary: View changes
Issue tags: -Needs merge request +Usability

@chaitanyadessai, when you make an MR it helps everyone if you remove the 'Needs merge request' tag.

@jesus_md, thanks for the screenshots. They should be added to the issue summary. This helps other contributors. reviewers and committers.

According to the Usability core gate, issues changing the UI are to be tagged 'Usability'.

Issues changing the UI should also have before and after screenshots, available from the issue summary.

Did some research and old_any was introduced in Views3 for Drupal 7, back in 2009.

quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record review

I searched for uses in contrib and there does appear to be some in PHP code in some projects. Those should be checked to determine if the module is compatible with Drupal 12. If so, then this setting should be deprecated instead of simply removed.

The change record has not been reviewed, so I am tagging for that and setting to needs work.

quietone’s picture

And I found an Feature Request for allowing the 'Any' label to be customized.

Tagging for Views maintainer review to decide if this should be done or #2156059: Allow the “Any” label to be customised in individual Views Grouped filters