From 6404071d4e66068fbc0855363c62992aee510190 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Thu, 2 Aug 2018 12:02:02 +0200 Subject: [PATCH] Sort allowed log actions when displaying This makes searching in the dropdown on Special:ApiSandbox simpler because it keeps actions of the same log type together. Change-Id: I240f5e19938393d5c15a1f5e7dd27780957231c0 --- includes/api/ApiQueryLogEvents.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 2d95cd3d18..3cb55e4169 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -388,6 +388,12 @@ class ApiQueryLogEvents extends ApiQueryBase { public function getAllowedParams( $flags = 0 ) { $config = $this->getConfig(); + if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) { + $logActions = $this->getAllowedLogActions(); + sort( $logActions ); + } else { + $logActions = null; + } $ret = [ 'prop' => [ ApiBase::PARAM_ISMULTI => true, @@ -411,9 +417,7 @@ class ApiQueryLogEvents extends ApiQueryBase { ], 'action' => [ // validation on request is done in execute() - ApiBase::PARAM_TYPE => ( $flags & ApiBase::GET_VALUES_FOR_HELP ) - ? $this->getAllowedLogActions() - : null + ApiBase::PARAM_TYPE => $logActions ], 'start' => [ ApiBase::PARAM_TYPE => 'timestamp' -- 2.20.1