diff options
Diffstat (limited to 'MLEB/Translate/api/ApiAggregateGroups.php')
-rw-r--r-- | MLEB/Translate/api/ApiAggregateGroups.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/MLEB/Translate/api/ApiAggregateGroups.php b/MLEB/Translate/api/ApiAggregateGroups.php index 5899bc07..7e403d84 100644 --- a/MLEB/Translate/api/ApiAggregateGroups.php +++ b/MLEB/Translate/api/ApiAggregateGroups.php @@ -34,12 +34,12 @@ class ApiAggregateGroups extends ApiBase { } $aggregateGroup = $params['aggregategroup']; $subgroups = TranslateMetadata::getSubgroups( $aggregateGroup ); - if ( !$subgroups ) { - // For newly created groups the subgroups value might be empty, - // but check that. - if ( TranslateMetadata::get( $aggregateGroup, 'name' ) === false ) { - $this->dieWithError( 'apierror-translate-invalidaggregategroup', 'invalidaggregategroup' ); - } + if ( $subgroups === null ) { + // For a newly created aggregate group, it may contain no subgroups, but null + // means the group does not exist or something has gone wrong. + + $this->dieWithError( 'apierror-translate-invalidaggregategroup', 'invalidaggregategroup' ); + // For static analysers $subgroups = []; } @@ -191,7 +191,7 @@ class ApiAggregateGroups extends ApiBase { return 'csrf'; } - public function getAllowedParams() { + protected function getAllowedParams() { return [ 'do' => [ ApiBase::PARAM_TYPE => [ 'associate', 'dissociate', 'remove', 'add', 'update' ], |