'Is empty' filter ignores empty string value ('') which is how webform saves empty values.

Created on 10 September 2025, about 1 month ago

Problem/Motivation

"Is empty (NULL)" and "Is not empty (NOT NULL)" filters do not work on webform submissions, because webform saves empty submission values as empty strings ('').

Steps to reproduce

  1. Create a webform
  2. Complete a submission, but deliberately leave a value empty
  3. Create a view and add a filter for that element and set the operator to "Is empty (NULL)"
  4. Go to the view page
  5. Notice your submission is not showing, even though the value is empty

Proposed resolution

The view filter plugins all use the opEmpty method (except WebformSubmissionCheckboxFilter). I propose a trait to alter this method and the database query within.

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

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

No activities found.

Production build 0.71.5 2024