ListController: Fix servicegrid grouping when applying group restrictions #2

PostgreSQL had still issues with it. Quickfix only, again.

refs #10316
This commit is contained in:
Johannes Meyer 2015-11-13 14:42:21 +01:00
parent 5e37f7758b
commit 26e6acf9af
3 changed files with 5 additions and 3 deletions

View File

@ -226,6 +226,7 @@ class PivotTable implements Sortable
{
if ($this->xAxisQuery === null) {
$this->xAxisQuery = clone $this->baseQuery;
$this->xAxisQuery->clearGroupingRules();
$xAxisHeader = $this->getXAxisHeader();
$columns = array($this->xAxisColumn, $xAxisHeader);
$this->xAxisQuery->group(array_unique($columns)); // xAxisColumn and header may be the same column
@ -253,6 +254,7 @@ class PivotTable implements Sortable
{
if ($this->yAxisQuery === null) {
$this->yAxisQuery = clone $this->baseQuery;
$this->yAxisQuery->clearGroupingRules();
$yAxisHeader = $this->getYAxisHeader();
$columns = array($this->yAxisColumn, $yAxisHeader);
$this->yAxisQuery->group(array_unique($columns)); // yAxisColumn and header may be the same column

View File

@ -545,7 +545,6 @@ class ListController extends Controller
$this->applyRestriction('monitoring/filter/objects', $query);
$this->filterQuery($query);
$filter = (bool) $this->params->shift('problems', false) ? Filter::where('service_problem', 1) : null;
$query->getQuery()->setGroupBase(array());
$pivot = $query
->pivot(
'service_description',

View File

@ -991,9 +991,10 @@ abstract class IdoQuery extends DbQuery
return $this;
}
public function setGroupBase(array $groupBase)
public function clearGroupingRules()
{
$this->groupBase = $groupBase;
$this->groupBase = array();
$this->groupOrigin = array();
return $this;
}