diff --git a/RELEASE-NOTES-1.35 b/RELEASE-NOTES-1.35 index 32077fc4ab9..fd43f4be69b 100644 --- a/RELEASE-NOTES-1.35 +++ b/RELEASE-NOTES-1.35 @@ -716,7 +716,7 @@ because of Phabricator reports. * ApiTestCase::doLogin, soft deprecated in 1.31, was hard deprecated. * WebRequest::getLimitOffset is hard deprecated. Instead, use ::getLimitOffsetForUser and pass a User object. -* PageArchive::getPreviousRevision is soft deprecated. Instead, use the new +* PageArchive::getPreviousRevision is hard deprecated. Instead, use the new ::getPreviousRevisionRecord method. * PageArchive::getArchivedRevision is hard deprecated. Instead, use the new ::getArchivedRevisionRecord method. diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php index 6c050686eb3..8b1c4cf2d40 100644 --- a/includes/page/PageArchive.php +++ b/includes/page/PageArchive.php @@ -325,6 +325,8 @@ class PageArchive { * @return Revision|null Null when there is no previous revision */ public function getPreviousRevision( $timestamp ) { + wfDeprecated( __METHOD__, '1.35' ); + $revRecord = $this->getPreviousRevisionRecord( $timestamp ); $rev = $revRecord ? new Revision( $revRecord ) : null; return $rev; diff --git a/tests/phpunit/includes/page/PageArchiveTest.php b/tests/phpunit/includes/page/PageArchiveTest.php index d7bc055a0f3..cc4639d3bc5 100644 --- a/tests/phpunit/includes/page/PageArchiveTest.php +++ b/tests/phpunit/includes/page/PageArchiveTest.php @@ -343,6 +343,8 @@ class PageArchiveTest extends MediaWikiTestCase { * @covers PageArchive::getPreviousRevision */ public function testGetPreviousRevision() { + $this->hideDeprecated( 'PageArchive::getPreviousRevision' ); + $rev = $this->archivedPage->getPreviousRevision( $this->ipRev->getTimestamp() ); $this->assertNotNull( $rev ); $this->assertSame( $this->firstRev->getId(), $rev->getId() );