*
* Some fields are public only for backwards-compatibility. Use accessors.
* In the past, this class was part of Article.php and everything was public.
+ *
+ * @phan-file-suppress PhanAccessMethodInternal Due to the use of DerivedPageDataUpdater
*/
class WikiPage implements Page, IDBAccessObject {
// Constants for $mDataLoadedFrom and related
*/
public $mLatest = false;
- /** @var PreparedEdit Map of cache fields (text, parser output, ect) for a proposed/new edit */
+ /**
+ * @var PreparedEdit|false Map of cache fields (text, parser output, ect) for a proposed/new edit
+ */
public $mPreparedEdit = false;
/**
// Try using the replica DB first, then try the master
$rev = $this->mTitle->getFirstRevision();
if ( !$rev ) {
- $rev = $this->mTitle->getFirstRevision( Title::GAID_FOR_UPDATE );
+ $rev = $this->mTitle->getFirstRevision( Title::READ_LATEST );
}
return $rev;
}
if ( !is_null( $nullRevision ) ) {
$logEntry->setAssociatedRevId( $nullRevision->getId() );
}
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
if ( $logRelationsField !== null && count( $logRelationsValues ) ) {
$logEntry->setRelations( [ $logRelationsField => $logRelationsValues ] );
}
$logEntry->setPerformer( $deleter );
$logEntry->setTarget( $logTitle );
$logEntry->setComment( $reason );
- $logEntry->setTags( $tags );
+ $logEntry->addTags( $tags );
$logid = $logEntry->insert();
$dbw->onTransactionPreCommitOrIdle(
*/
protected function archiveRevisions( $dbw, $id, $suppress ) {
global $wgContentHandlerUseDB, $wgMultiContentRevisionSchemaMigrationStage,
- $wgActorTableSchemaMigrationStage, $wgDeleteRevisionsBatchSize;
+ $wgDeleteRevisionsBatchSize;
// Given the lock above, we can be confident in the title and page ID values
$namespace = $this->getTitle()->getNamespace();
$dbw->delete( 'revision', [ 'rev_id' => $revids ], __METHOD__ );
$dbw->delete( 'revision_comment_temp', [ 'revcomment_rev' => $revids ], __METHOD__ );
- if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
- $dbw->delete( 'revision_actor_temp', [ 'revactor_rev' => $revids ], __METHOD__ );
- }
+ $dbw->delete( 'revision_actor_temp', [ 'revactor_rev' => $revids ], __METHOD__ );
// Also delete records from ip_changes as applicable.
if ( count( $ipRevIds ) > 0 ) {
public function commitRollback( $fromP, $summary, $bot,
&$resultDetails, User $guser, $tags = null
) {
- global $wgUseRCPatrol;
+ global $wgUseRCPatrol, $wgDisableAnonTalk;
$dbw = wfGetDB( DB_MASTER );
if ( empty( $summary ) ) {
if ( !$currentEditorForPublic ) { // no public user name
$summary = wfMessage( 'revertpage-nouser' );
+ } elseif ( $wgDisableAnonTalk && $current->getUser() === 0 ) {
+ $summary = wfMessage( 'revertpage-anon' );
} else {
$summary = wfMessage( 'revertpage' );
}