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.

CommentFileSizeAuthor
null_is_empty.patch956 bytesstackpr

Comments

dawehner’s picture

Assigned: Unassigned » merlinofchaos

Not sure whether this makes sense or not so assign to merlinfochaos

mustanggb’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)