diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php index 5655da1..6159534 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/argument/Search.php @@ -103,7 +103,7 @@ public function query($group_by = FALSE) { } $this->query->addWhere(0, $search_condition); - $this->query->add_groupby("$search_index.sid"); + $this->query->addGroupBy("$search_index.sid"); $matches = $this->search_query->matches(); $placeholder = $this->placeholder(); $this->query->addHavingExpression(0, "COUNT(*) >= $placeholder", array($placeholder => $matches)); diff --git a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php index 250ab4f..6ca3089 100644 --- a/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php +++ b/core/modules/search/lib/Drupal/search/Plugin/views/filter/Search.php @@ -183,7 +183,7 @@ public function query() { } $this->query->addWhere($this->options['group'], $search_condition); - $this->query->add_groupby("$search_index.sid"); + $this->query->addGroupBy("$search_index.sid"); $matches = $this->search_query->matches(); $placeholder = $this->placeholder(); $this->query->addHavingExpression($this->options['group'], "COUNT(*) >= $placeholder", array($placeholder => $matches)); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php index dd86190..b59e25f 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php @@ -795,7 +795,7 @@ protected function defaultSummary() { * Build the info for the summary query. * * This must: - * - add_groupby: group on this field in order to create summaries. + * - addGroupBy: group on this field in order to create summaries. * - addField: add a 'num_nodes' field for the count. Usually it will * be a count on $view->base_field * - set_count_field: Reset the count field so we get the right paging. @@ -856,7 +856,7 @@ public function summaryBasics($count_field = TRUE) { $distinct = ($this->view->display_handler->getOption('distinct') && empty($this->query->no_distinct)); $count_alias = $this->query->addField($this->view->storage->get('base_table'), $this->view->storage->get('base_field'), 'num_records', array('count' => TRUE, 'distinct' => $distinct)); - $this->query->add_groupby($this->name_alias); + $this->query->addGroupBy($this->name_alias); if ($count_field) { $this->query->set_count_field($this->tableAlias, $this->realField); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php index e76eb60..e75cde1 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -972,17 +972,6 @@ function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params 'field' => $as, 'direction' => strtoupper($order) ); - - /** - * -- removing, this should be taken care of by field adding now. - * -- leaving commented because I am unsure. - // If grouping, all items in the order by must also be in the - // group by clause. Check $table to ensure that this is not a - // formula. - if ($this->groupby && $table) { - $this->add_groupby($as); - } - */ } /** @@ -990,7 +979,7 @@ function add_orderby($table, $field = NULL, $order = 'ASC', $alias = '', $params * for ensuring that the fields are fully qualified and the table is properly * added. */ - function add_groupby($clause) { + public function addGroupBy($clause) { // Only add it if it's not already in there. if (!in_array($clause, $this->groupby)) { $this->groupby[] = $clause; @@ -1201,7 +1190,7 @@ public function query($get_count = FALSE) { // Check query distinct value. if (empty($this->no_distinct) && $this->distinct && !empty($this->fields)) { $base_field_alias = $this->addField($this->view->storage->get('base_table'), $this->view->storage->get('base_field')); - $this->add_groupby($base_field_alias); + $this->addGroupBy($base_field_alias); $distinct = TRUE; }