At the moment we have option to choose either AND or OR for group operator. It would be useful to allow negating conditions with NOT (AND NOT, OR NOT).

In views_plugin_query_default::build_condition() we could either whitelist allowed conditions or allow custom ones with db_condition().

This is basically what I need for current project but ideally it would be best to add all conjunction/disjunction operators: AND, OR, XOR, NAND, NOR and XNOR

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Status: Active » Needs review
FileSize
2.38 KB

proof of concept

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 2 year old patch in #2 to admin.inc and views_plugin_query_default.inc does not apply to the latest views 7.x-3.x-dev and if still relevant needs to be rerolled.

Checking patch includes/admin.inc...
Hunk #1 succeeded at 2455 (offset 93 lines).
error: while searching for:
  $form['filter_groups']['#tree'] = TRUE;
  $form['filter_groups']['operator'] = array(
    '#type' => 'select',
    '#options' => array (
      'AND' => t('And'),
      'OR' => t('Or'),
    ),
    '#default_value' => $groups['operator'],
    '#attributes' => array(
      'class' => array('warning-on-change'),

error: patch failed: includes/admin.inc:3698
error: includes/admin.inc: patch does not apply

Checking patch plugins/views_plugin_query_default.inc...
Hunk #1 succeeded at 1141 (offset 19 lines).
Andrew Answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.38 KB

Patch rerolled.