Migrate ApiQueryLogEvents from tag_summary to change_tag
[lhc/web/wiklou.git] / includes / api / ApiQueryLogEvents.php
index 2d95cd3..ba04193 100644 (file)
@@ -109,9 +109,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                }
 
                if ( $this->fld_tags ) {
-                       $this->addTables( 'tag_summary' );
-                       $this->addJoinConds( [ 'tag_summary' => [ 'LEFT JOIN', 'log_id=ts_log_id' ] ] );
-                       $this->addFields( 'ts_tags' );
+                       $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'logging' ) ] );
                }
 
                if ( !is_null( $params['tag'] ) ) {
@@ -388,6 +386,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 +415,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'