From 2d19db5ee3d6bd3d9c015caa0729984a2d915e8f Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 12 Nov 2021 12:20:10 +0100 Subject: [PATCH] Don't sort by host/service display_name simultaneously Simultaneous sorting by `host.display_name` and `service.display_name` and vice versa prevents the use of the display_name indexes. Co-authored-by: Eric Lippmann --- application/controllers/CommentsController.php | 10 +++++----- application/controllers/DowntimesController.php | 4 ++-- application/controllers/ServicesController.php | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/application/controllers/CommentsController.php b/application/controllers/CommentsController.php index caeea954..d764732e 100644 --- a/application/controllers/CommentsController.php +++ b/application/controllers/CommentsController.php @@ -43,11 +43,11 @@ class CommentsController extends Controller $sortControl = $this->createSortControl( $comments, [ - 'comment.entry_time desc' => t('Entry Time'), - 'host.display_name, service.display_name' => t('Host'), - 'service.display_name, host.display_name' => t('Service'), - 'comment.author' => t('Author'), - 'comment.expire_time desc' => t('Expire Time') + 'comment.entry_time desc' => t('Entry Time'), + 'host.display_name' => t('Host'), + 'service.display_name' => t('Service'), + 'comment.author' => t('Author'), + 'comment.expire_time desc' => t('Expire Time') ] ); $viewModeSwitcher = $this->createViewModeSwitcher($paginationControl, $limitControl); diff --git a/application/controllers/DowntimesController.php b/application/controllers/DowntimesController.php index d9812c64..3328424c 100644 --- a/application/controllers/DowntimesController.php +++ b/application/controllers/DowntimesController.php @@ -45,8 +45,8 @@ class DowntimesController extends Controller [ 'downtime.is_in_effect desc, downtime.start_time desc' => t('Is In Effect'), 'downtime.entry_time' => t('Entry Time'), - 'host.display_name, service.display_name' => t('Host'), - 'service.display_name, host.display_name' => t('Service'), + 'host.display_name' => t('Host'), + 'service.display_name' => t('Service'), 'downtime.author' => t('Author'), 'downtime.start_time desc' => t('Start Time'), 'downtime.end_time desc' => t('End Time'), diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index 228c6c76..9464be73 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -61,11 +61,11 @@ class ServicesController extends Controller $sortControl = $this->createSortControl( $services, [ - 'service.display_name, host.display_name' => t('Name'), - 'service.state.severity desc' => t('Severity'), - 'service.state.soft_state' => t('Current State'), - 'service.state.last_state_change desc' => t('Last State Change'), - 'host.display_name, service.display_name' => t('Host') + 'service.display_name' => t('Name'), + 'service.state.severity desc' => t('Severity'), + 'service.state.soft_state' => t('Current State'), + 'service.state.last_state_change desc' => t('Last State Change'), + 'host.display_name' => t('Host') ] ); $viewModeSwitcher = $this->createViewModeSwitcher($paginationControl, $limitControl);