*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Storage\NameTableAccessException;
use MediaWiki\Storage\RevisionRecord;
/**
}
protected function run( ApiPageSet $resultPageSet = null ) {
+ global $wgChangeTagsSchemaMigrationStage;
+
$user = $this->getUser();
// Before doing anything at all, let's check permissions
$this->checkUserRightsAny( 'deletedhistory' );
$this->addJoinConds(
[ 'change_tag' => [ 'INNER JOIN', [ 'ar_rev_id=ct_rev_id' ] ] ]
);
- $this->addWhereFld( 'ct_tag', $params['tag'] );
+ 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'] );
+ }
}
if ( $this->fetchContent ) {
protected function getExamplesMessages() {
return [
'action=query&prop=deletedrevisions&titles=Main%20Page|Talk:Main%20Page&' .
- 'drvprop=user|comment|content'
+ 'drvslots=*&drvprop=user|comment|content'
=> 'apihelp-query+deletedrevisions-example-titles',
'action=query&prop=deletedrevisions&revids=123456'
=> 'apihelp-query+deletedrevisions-example-revids',