$updater = $this->getDerivedDataUpdater( $user, $revision, $slots );
if ( !$updater->isUpdatePrepared() ) {
- $updater->prepareContent( $user, $slots, [], $useCache );
+ $updater->prepareContent( $user, $slots, $useCache );
if ( $revision ) {
$updater->prepareUpdate( $revision );
// Note array_intersect() preserves keys from the first arg, and we're
// assuming $revQuery has `revision` primary and isn't using subtables
// for anything we care about.
- $res = $dbw->select(
+ $dbw->lockForUpdate(
array_intersect(
$revQuery['tables'],
[ 'revision', 'revision_comment_temp', 'revision_actor_temp' ]
),
- '1',
[ 'rev_page' => $id ],
__METHOD__,
- 'FOR UPDATE',
+ [],
$revQuery['joins']
);
- foreach ( $res as $row ) {
- // Fetch all rows in case the DB needs that to properly lock them.
- }
// Get all of the page revisions
$res = $dbw->select(
}
$updater->setOriginalRevisionId( $target->getId() );
- $updater->setUndidRevisionId( $current->getId() );
+ // Do not call setUndidRevisionId(), that causes an extra "mw-undo" tag to be added (T190374)
$updater->addTags( $tags );
// TODO: this logic should not be in the storage layer, it's here for compatibility