$fld_details = false, $fld_tags = false;
public function execute() {
- global $wgChangeTagsSchemaMigrationStage;
-
$params = $this->extractRequestParams();
$db = $this->getDB();
$this->commentStore = CommentStore::getStore();
}
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'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN',
[ 'log_id=ct_log_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' );
}
}