Commit 8c3f0ae2 authored by dawehner's avatar dawehner Committed by tim.plunkett
Browse files

Issue #1757302 by dawehner: Fix grouping errors in HandlerBase.

parent c0bb4f6b
......@@ -182,8 +182,11 @@ function get_field($field = NULL) {
$this->view->init_query();
if ($this->query) {
$info = $this->query->get_aggregation_info();
if (!empty($info[$this->options['group_type']]['method']) && function_exists($info[$this->options['group_type']]['method'])) {
return $info[$this->options['group_type']]['method']($this->options['group_type'], $field);
if (!empty($info[$this->options['group_type']]['method'])) {
$method = $info[$this->options['group_type']]['method'];
if (method_exists($this->query, $method)) {
return $this->query->$method($this->options['group_type'], $field);
}
}
}
}
......@@ -311,7 +314,7 @@ function use_group_by() {
function groupby_form(&$form, &$form_state) {
$view = &$form_state['view'];
$display_id = $form_state['display_id'];
$types = Views::views_object_types();
$types = View::views_object_types();
$type = $form_state['type'];
$id = $form_state['id'];
......
......@@ -250,7 +250,7 @@ public function testGroupByCountOnlyFilters() {
$this->assertTrue(strpos($view->build_info['query'], 'HAVING'), t('Make sure that HAVING is in the query'));
}
function viewsGroupByCountViewOnlyFilters() {
public function viewsGroupByCountViewOnlyFilters() {
$view = new View();
$view->name = 'group_by_in_filters';
$view->description = '';
......@@ -270,7 +270,7 @@ function viewsGroupByCountViewOnlyFilters() {
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Nodo: Tipo */
/* Field: Node: Type */
$handler->display->display_options['fields']['type']['id'] = 'type';
$handler->display->display_options['fields']['type']['table'] = 'node';
$handler->display->display_options['fields']['type']['field'] = 'type';
......@@ -284,7 +284,7 @@ function viewsGroupByCountViewOnlyFilters() {
$handler->display->display_options['fields']['type']['hide_empty'] = 0;
$handler->display->display_options['fields']['type']['empty_zero'] = 0;
$handler->display->display_options['fields']['type']['link_to_node'] = 0;
/* Filtrar: Nodo: Nid */
/* Filter: Node: Nid */
$handler->display->display_options['filters']['nid']['id'] = 'nid';
$handler->display->display_options['filters']['nid']['table'] = 'node';
$handler->display->display_options['filters']['nid']['field'] = 'nid';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment