* @return void
*/
protected function run( ApiPageSet $resultPageSet = null ) {
- global $wgChangeTagsSchemaMigrationStage;
-
// Before doing anything at all, let's check permissions
$this->checkUserRightsAny( 'deletedhistory' );
}
if ( $this->fld_tags ) {
- $this->addTables( 'tag_summary' );
- $this->addJoinConds(
- [ 'tag_summary' => [ 'LEFT JOIN', [ 'ar_rev_id=ts_rev_id' ] ] ]
- );
- $this->addFields( 'ts_tags' );
+ $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'archive' ) ] );
}
if ( !is_null( $params['tag'] ) ) {
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
);
- if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
- $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
- try {
- $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
- } catch ( NameTableAccessException $exception ) {
- // Return nothing.
- $this->addWhere( '1=0' );
- }
- } else {
- $this->addWhereFld( 'ct_tag', $params['tag'] );
+ $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
+ try {
+ $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
+ } catch ( NameTableAccessException $exception ) {
+ // Return nothing.
+ $this->addWhere( '1=0' );
}
}