diff --git a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php index a4cded4..7f4a607 100644 --- a/core/modules/views/src/Plugin/views/filter/BooleanOperator.php +++ b/core/modules/views/src/Plugin/views/filter/BooleanOperator.php @@ -76,14 +76,14 @@ protected function operators() { return array( '=' => array( 'title' => $this->t('Is equal to'), - 'method' => 'queryOpBoolean', + 'method' => 'queryOperatorBoolean', 'short' => $this->t('='), 'values' => 1, 'query_operator' => static::EQUAL, ), '!=' => array( 'title' => $this->t('Is not equal to'), - 'method' => 'queryOpBoolean', + 'method' => 'queryOperatorBoolean', 'short' => $this->t('!='), 'values' => 1, 'query_operator' => static::NOT_EQUAL, @@ -226,15 +226,29 @@ public function query() { } /** + * Adds a where condition to the query for a boolean value. This function + * remains to prevent breaks in public-facing API's. + * + * @param string $field + * The field name to add the where condition for. + * + * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. + * Use Drupal\views\Plugin\views\filter\BooleanOperator::queryOperatorBoolean + * instead. + */ + protected function queryOpBoolean($field) { + $this->queryOperatorBoolean($field, static::EQUAL); + } + + /** * Adds a where condition to the query for a boolean value. * * @param string $field * The field name to add the where condition for. * @param string $query_operator - * (optional) Either static::EQUAL or static::NOT_EQUAL. Defaults to - * static::EQUAL. + * Either static::EQUAL or static::NOT_EQUAL. */ - protected function queryOpBoolean($field, $query_operator = EQUAL) { + protected function queryOperatorBoolean($field, $query_operator) { if (empty($this->value)) { if ($this->accept_null) { if ($query_operator == static::EQUAL) {