diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2020-04-19 01:29:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2020-04-19 01:29:40 +0000 |
commit | 6660f5ccd86f8c7479788a7b8ba26e0999b3b3fd (patch) | |
tree | cd0ab07f0969553eef37d03fcc90ed8d028442a3 | |
parent | 5a939b9a7d2c2bd527e0b730c91a54b081538bde (diff) | |
parent | 1d560e1d4b147261c64b433065c58d246c4b1822 (diff) | |
download | mediawikicore-6660f5ccd86f8c7479788a7b8ba26e0999b3b3fd.tar.gz mediawikicore-6660f5ccd86f8c7479788a7b8ba26e0999b3b3fd.zip |
Merge "Hard deprecate WikiPage::insertProtectNullRevision"
-rw-r--r-- | RELEASE-NOTES-1.35 | 7 | ||||
-rw-r--r-- | includes/page/Article.php | 2 | ||||
-rw-r--r-- | includes/page/WikiPage.php | 8 | ||||
-rw-r--r-- | tests/phpunit/includes/page/WikiPageDbTest.php | 1 |
4 files changed, 9 insertions, 9 deletions
diff --git a/RELEASE-NOTES-1.35 b/RELEASE-NOTES-1.35 index ebe4573b9345..b4c67c1508ae 100644 --- a/RELEASE-NOTES-1.35 +++ b/RELEASE-NOTES-1.35 @@ -691,7 +691,6 @@ because of Phabricator reports. user is hard deprecated, and support for calling them without passing a user will be removed in 1.36: - Title::getNotificationTimestamp - - WikiPage::insertProtectNullRevision - PatrolLog::record - LogEventsList::userCan - LogEventsList::userCanBitfield @@ -712,8 +711,8 @@ because of Phabricator reports. - WikiPage::getCreator - WikiPage::getUser - WikiPage::getUserText -* Article::insertProtectNullRevision is deprecated. Instead, use - WikiPage::insertProtectNullRevision. +* Article::insertProtectNullRevision and WikiPage::insertProtectNullRevision + were hard deprecated. Instead, use WikiPage::insertNullProtectionRevision. * Article::doDeleteArticle, Article::doDeleteArticleReal, and WikiPage::doDeleteArticle are all deprecated. Instead, use WikiPage::doDeleteArticleReal. @@ -922,8 +921,6 @@ because of Phabricator reports. * ParserOptions::getCurrentRevisionCallback and ::setCurrentRevisionCallback were soft deprecated in favor of the new ::getCurrentRevisionRecordCallback and ::setCurrentRevisionRecordCallback methods respectively. -* WikiPage::insertProtectNullRevision was soft deprecated in favor of the - new insertNullProtectionRevision method. * Page interface was deprecated. Use Article or WikiPage instead. * The following DatabaseBlock methods are deprecated because they are no longer needed in core: chooseBlock, fromMaster, deleteIfExpired. diff --git a/includes/page/Article.php b/includes/page/Article.php index e7f10f60c069..82489b996662 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -2705,7 +2705,7 @@ class Article implements Page { /** * Call to WikiPage function for backwards compatibility. * @see WikiPage::insertProtectNullRevision - * @deprecated since 1.35, use WikiPage::insertProtectNullRevision instead + * @deprecated since 1.35, use WikiPage::insertNullProtectionRevision instead * @param string $revCommentMsg * @param array $limit * @param array $expiry diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index b4355933b0df..4dafc65e3191 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2291,7 +2291,7 @@ class WikiPage implements Page, IDBAccessObject { // insert null revision to identify the page protection change as edit summary $latest = $this->getLatest(); - $nullRevision = $this->insertProtectNullRevision( + $nullRevisionRecord = $this->insertNullProtectionRevision( $revCommentMsg, $limit, $expiry, @@ -2300,7 +2300,7 @@ class WikiPage implements Page, IDBAccessObject { $user ); - if ( $nullRevision === null ) { + if ( $nullRevisionRecord === null ) { return Status::newFatal( 'no-null-revision', $this->mTitle->getPrefixedText() ); } @@ -2365,6 +2365,8 @@ class WikiPage implements Page, IDBAccessObject { // Avoid PHP 7.1 warning of passing $this by reference $wikiPage = $this; + // TODO replace hook with one using RevisionRecord + $nullRevision = new Revision( $nullRevisionRecord ); Hooks::run( 'NewRevisionFromEditComplete', [ $this, $nullRevision, $latest, $user, &$tags ] ); Hooks::run( 'ArticleProtectComplete', [ &$wikiPage, &$user, $limit, $reason ] ); @@ -2449,8 +2451,8 @@ class WikiPage implements Page, IDBAccessObject { public function insertProtectNullRevision( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user = null ) { + wfDeprecated( __METHOD__, '1.35' ); if ( !$user ) { - wfDeprecated( __METHOD__ . ' without passing a $user parameter', '1.35' ); global $wgUser; $user = $wgUser; } diff --git a/tests/phpunit/includes/page/WikiPageDbTest.php b/tests/phpunit/includes/page/WikiPageDbTest.php index c1a4c3f3c4a9..caac1e24e3b6 100644 --- a/tests/phpunit/includes/page/WikiPageDbTest.php +++ b/tests/phpunit/includes/page/WikiPageDbTest.php @@ -1863,6 +1863,7 @@ more stuff $reason, $expectedComment ) { + $this->hideDeprecated( 'WikiPage::insertProtectNullRevision' ); $this->setContentLang( 'qqx' ); $page = $this->createPage( __METHOD__, 'Goat' ); |