*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Storage\NameTableAccessException;
-use MediaWiki\Storage\RevisionRecord;
/**
* A query action to enumerate the recent changes that were done to the wiki.
* @param ApiPageSet|null $resultPageSet
*/
public function run( $resultPageSet = null ) {
- global $wgChangeTagsSchemaMigrationStage;
-
$user = $this->getUser();
/* Get the parameters of the request. */
$params = $this->extractRequestParams();
$resultPageSet && $params['generaterevisions'] );
if ( $this->fld_tags ) {
- $this->addTables( 'tag_summary' );
- $this->addJoinConds( [ 'tag_summary' => [ 'LEFT JOIN', [ 'rc_id=ts_rc_id' ] ] ] );
- $this->addFields( 'ts_tags' );
+ $this->addFields( [ 'ts_tags' => ChangeTags::makeTagSummarySubquery( 'recentchanges' ) ] );
}
if ( $this->fld_sha1 ) {
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
$this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN', [ 'rc_id=ct_rc_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' );
}
}