views_filter_or_null
Views Filter OR NULL extends standard Views filter handlers (string, numeric, date, boolean) with OR NULL operator variants. This solves a common limitation: when using grouped filters, it is impossible to natively combine a condition with OR NULL to include rows where the field has no value.
Features
- Adds OR NULL variants for every single-value operator in string, numeric, date, and boolean filters (e.g. "Contains OR NULL", "Equals OR NULL", "Less than OR NULL").
- Each new operator returns rows where the field matches the condition or the field has no value (NULL).
- Designed for use in grouped filters where fields are optional and NULL rows must not be excluded.
- Drop-in replacement: the new filter handlers extend the native ones and appear in the Views UI like any other filter.
Use case: A view listing events filtered by a category field. Some events have no category (NULL). Using "Equals OR NULL", the filter returns events of the selected category plus uncategorized ones — impossible with the native "Equals" operator inside a grouped filter.
Post-Installation
No configuration page. After enabling the module:
- Open or create a View.
- Add a filter on a field (text, number, date, or boolean).
- Change the filter handler to the OR NULL variant (e.g. String OR NULL).
- Select an operator ending in OR NULL and enter the filter value.
Additional Requirements
Drupal core Views module (included in Drupal core since 8.x). No additional modules or libraries required.
Recommended modules/libraries
No specific recommendations. The module works out of the box with any Views-based setup, including exposed filters and grouped filters.
Similar projects
Views Filter OR NULL is the only module known at this time specifically targeting the OR NULL operator gap in grouped and exposed filters.