Backport exposed numeric/date filters with multiple form elements label fix

Created on 25 September 2023, over 1 year ago

Problem/Motivation

In the Drupal 8+ core version of views the exposed numeric/date filters with multiple form elements was adjusted. That change I think should be backported to Drupal 7 version of views (or atleast a version of it).

The main issue is that when exposing a views filter on a numeric or date field the labels shown are missing except for 'And'. 'Min' is hidden and so is 'Value' when not using the range operations.

Steps to reproduce

  1. Create a view and add a exposed post date filter and check the 'Expose operator' option.
  2. Navigate to the view or use the preview on the views UI.
  3. Confirm that when the operation 'Is greater than' there is no label for the form field (no hidden label either). You can also run Wave accessibility browser extension tool to confirm that.
  4. Switch the operation to 'Is between' and confirm that the max value has the label 'And' but the min value has no label.

Proposed resolution

Copying the solution from https://www.drupal.org/project/drupal/issues/2625136 πŸ› Fix label visibility and add wrapper container for exposed numeric/date filters with multiple form elements Fixed , switch the labels for min and max to 'Min' and 'Max' without any checks for exposed or not.

For the 'value-value' field set the label to 'Value' but use the exposed attribute to toggle '#title_display' as being invisible or not.

Remaining tasks

  • Provide a patch. - Done
  • Add screenshots. - Done

User interface changes

Before when configuring the exposed filters

Before when viewing the exposed filters

After when configuring the exposed filters

After when viewing the exposed filters

πŸ› Bug report
Status

Needs work

Version

3.0

Component

exposed filters

Created by

πŸ‡ΊπŸ‡ΈUnited States dmundra Eugene, OR

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

Comments & Activities

Production build 0.71.5 2024