From 8fdf20fbf25b7877da0f188434e7e90f362b6fbf Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 3 Sep 2014 18:55:20 +0200 Subject: [PATCH] Groupsummary: remove invalid sort column discovery This didn't result in a loop 'til now as it wasn't even used. The problem here is that the same View is used for tow differend things, this makes no sense. In the meantime removing that code fixes related problems. --- .../application/controllers/ChartController.php | 4 ++-- .../library/Monitoring/DataView/Groupsummary.php | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index af6240259..8cf6f8bd4 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -99,7 +99,7 @@ class Monitoring_ChartController extends Controller 'services_warning_unhandled', 'services_pending' ) - )->getQuery()->fetchAll(); + )->order('hostgroup')->getQuery()->fetchAll(); $this->view->height = intval($this->getParam('height', 500)); $this->view->width = intval($this->getParam('width', 500)); if (count($query) === 1) { @@ -124,7 +124,7 @@ class Monitoring_ChartController extends Controller 'services_warning_unhandled', 'services_pending' ) - )->getQuery()->fetchAll(); + )->order('servicegroup')->getQuery()->fetchAll(); $this->view->height = intval($this->getParam('height', 500)); $this->view->width = intval($this->getParam('width', 500)); diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php index a623dab45..72b021fa9 100644 --- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php +++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php @@ -37,20 +37,4 @@ class Groupsummary extends DataView 'services_pending' ); } - - public function getSortRules() - { - if (in_array('servicegroup', $this->getQuery()->getColumns())) { - return array( - 'servicegroup' => array( - 'order' => self::SORT_ASC - ) - ); - } - return array( - 'hostgroup' => array( - 'order' => self::SORT_ASC - ) - ); - } }