I have a Views filter handler, which does
$this->query->add_where( $this->options['group'], $this->real_field, vms_get_current_mlid(), $this->operator = ($this->operator == '=') ? 'IN' : 'NOT IN' );
Which initially looks fine, but fails with "NOT IN", when the field value is NULL, as
NOT IN (100) does not return TRUE for a NULL value, which is what I would like.
When the operator is 'NOT IN', I need to add a "OR IS NULL" operator as well, but still keep it within the same group.
If the filters are
Node is "page" AND NID_REFERENCE NOT IN (100, 101, 102)
I would like that to become
Node is "page" AND (NID_REFERENCE NOT IN (100, 101, 102) OR NID_REFERENCE IS NOT NULL)
How do I do that?