The 'Exposed Filter Required' setting displays a default value error when the view is saved.

Created on 11 April 2025, 5 days ago

Problem/Motivation

When creating a view with an exposed filter (such as a select dropdown) and marking it as "Required", Views forces a default value to be set. This breaks the desired functionality where the form should initially display an empty "Select..." option and not show any results until the user actively selects a value.

For example, if we create a select field with:
- (Empty option) Select City
- City 1
- City 2

...and mark it as required, Views demands that a default value be provided. Once a default is set (e.g., City 1), the exposed form loads with City 1 preselected and results filtered accordingly, instead of waiting for user input. This prevents the form from behaving like a proper required filter.

This issue makes it impossible to build user-friendly, truly required filters that don't show results until a user makes a conscious choice.

Steps to reproduce

1. Create a View with an exposed filter using a select field (e.g., taxonomy or list field).
2. Enable the "Required" checkbox for the exposed filter.
3. Try to save the view without setting a default value — Views throws a validation error requiring a default.
4. Set a default value (e.g., City 1) to proceed.
5. Load the View page — the form loads with City 1 preselected and filtered results displayed, even though no user input occurred.

Proposed resolution

Allow required exposed filters to without default value

🐛 Bug report
Status

Active

Version

10.5 ✹

Component

views.module

Created by

🇮🇳India Ujjval Kumar Jha

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the “VDC” tag instead.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024