Query condition that needs to return true no longer working I'm working on updating our sites to D9. One of our custom modules stopped working and I narrowed it down to this bit of code that modifies some query conditions for a view filter. It's trying to set a condition that always returns true (i.e. 1 = 1).
function views_taxonomy_filter_process_query_conditions(array &amp;$conditions, $field) {
  foreach (Element::children($conditions) as $key) {
    if ($conditions[$key]['field'] instanceof ConditionInterface) {
      $child = &amp; $conditions[$key]['field']-&gt;conditions();
      views_taxonomy_filter_process_query_conditions($child, $field);
    }
    elseif (strpos($conditions[$key]['field'], $field) !== FALSE) {
      // We cannot just unset the condition, because this action might create
      // incorrect query. Let's replace it with 1 = 1 condition.
      $conditions[$key] = [
        'field' =&gt; 1,
        'value' =&gt; 1,
        'operator' =&gt; '=',
      ];
    }
  }
}

This worked fine in D8. However I'm now getting this error as it seems to be looking for a column called 1 instead of evaluating that condition:
Drupal\Core\Database\DatabaseExceptionWrapper: 
SQLSTATE[42S22]: Column not found: 1054 Unknown column '1' in 'where clause'

How can I change this to restore the old functionality? Thank you!
I found out here that since Drupal 8.7.0 (at least) the field part of the condition can not be an expression.
Since you can't use &quot;where&quot; you must figure out another way to force the condition to always be true. Maybe you could mess around with the operator like this:

Instead of overriding the entire condition, use the &quot;LIKE&quot; operator:
$conditions[$key]['value'] = '%';
$conditions[$key]['operator'] = 'like';


Or if that doesn't work, the &quot;NOT IN&quot; operator:
$conditions[$key]['value'] = array('w00t');
$conditions[$key]['operator'] = 'NOT IN';



Hope this helps you!