If no text is entered into the exposed form field, then we still get "... LIKE UPPER('%%')" from views_handler_filter_string. I can understand wanting to keep that portion of the WHERE clause in place, but it seems like a NULL field should match when no search term is provided. Minimally, that should be optional.
For a simple fix that should work in the major databases, I wrapped the field value in COALESCE.
I filed this as a feature request because I assume the NULL vs '' is an intentional differentiation. If it is not intentional, then the patch should do the trick and similar additions could probably be made elsewhere for other exposed filters.
| Comment | File | Size | Author |
|---|---|---|---|
| null_is_empty.patch | 956 bytes | stackpr |
Comments
Comment #1
dawehnerNot sure whether this makes sense or not so assign to merlinfochaos
Comment #2
mustanggb commented