diff options
author | DannyS712 <DannyS712.enwiki@gmail.com> | 2020-04-11 05:08:23 +0000 |
---|---|---|
committer | DannyS712 <DannyS712.enwiki@gmail.com> | 2020-04-15 05:43:43 +0000 |
commit | 76cf98a3b19ff52cfe4f344f6b196858a2949618 (patch) | |
tree | baaf2ab3965dd0998bace1e699113268de30e63d /includes/specials/helpers | |
parent | 495a4b58878b5df4546c3fc73a4591c403b9d8c2 (diff) | |
download | mediawikicore-76cf98a3b19ff52cfe4f344f6b196858a2949618.tar.gz mediawikicore-76cf98a3b19ff52cfe4f344f6b196858a2949618.zip |
Replace uses and hard deprecate Revision::newNullRevision
Bug: T249979
Change-Id: I84bb08032278248bbcc4d620a28f45504ab85d35
Diffstat (limited to 'includes/specials/helpers')
-rw-r--r-- | includes/specials/helpers/ImportReporter.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/includes/specials/helpers/ImportReporter.php b/includes/specials/helpers/ImportReporter.php index 194ddd2bc638..35522639f885 100644 --- a/includes/specials/helpers/ImportReporter.php +++ b/includes/specials/helpers/ImportReporter.php @@ -131,24 +131,30 @@ class ImportReporter extends ContextSource { . $this->reason; } - $comment = $detail; // quick + $comment = CommentStoreComment::newUnsavedComment( $detail ); $dbw = wfGetDB( DB_MASTER ); + $revStore = MediaWikiServices::getInstance()->getRevisionStore(); $latest = $title->getLatestRevID(); - $nullRevision = Revision::newNullRevision( + $nullRevRecord = $revStore->newNullRevision( $dbw, - $title->getArticleID(), + $title, $comment, true, $this->getUser() ); $nullRevId = null; - if ( $nullRevision !== null ) { - $nullRevId = $nullRevision->insertOn( $dbw ); + if ( $nullRevRecord !== null ) { + $inserted = $revStore->insertRevisionOn( $nullRevRecord, $dbw ); + $nullRevId = $inserted->getId(); $page = WikiPage::factory( $title ); - # Update page record + // Update page record + // TODO WikiPage::updateRevisionOn should accept RevisionRecord + $nullRevision = new Revision( $inserted ); $page->updateRevisionOn( $dbw, $nullRevision ); $fakeTags = []; + + // TODO replace hook Hooks::run( 'NewRevisionFromEditComplete', [ $page, $nullRevision, $latest, $this->getUser(), &$fakeTags ] |