diff options
-rw-r--r-- | includes/Output/OutputPage.php | 1 | ||||
-rw-r--r-- | includes/diff/DifferenceEngine.php | 2 | ||||
-rw-r--r-- | includes/page/Article.php | 6 | ||||
-rw-r--r-- | tests/phpunit/includes/Output/OutputPageTest.php | 1 |
4 files changed, 6 insertions, 4 deletions
diff --git a/includes/Output/OutputPage.php b/includes/Output/OutputPage.php index 0a33bb608ccd..80fd513cc61b 100644 --- a/includes/Output/OutputPage.php +++ b/includes/Output/OutputPage.php @@ -2102,6 +2102,7 @@ class OutputPage extends ContextSource { * @deprecated since 1.44, use ::getMetadata()->setRevisionTimestamp(...) */ public function setRevisionTimestamp( $timestamp ) { + wfDeprecated( __METHOD__, '1.44' ); $previousValue = $this->metadata->getRevisionTimestamp(); $this->metadata->setRevisionTimestamp( $timestamp ); return $previousValue; diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index faca5c529263..e5a3b1428525 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1238,7 +1238,7 @@ class DifferenceEngine extends ContextSource { $out->setRevisionId( $this->mNewid ); $out->setRevisionIsCurrent( $this->mNewRevisionRecord->isCurrent() ); - $out->setRevisionTimestamp( $this->mNewRevisionRecord->getTimestamp() ); + $out->getMetadata()->setRevisionTimestamp( $this->mNewRevisionRecord->getTimestamp() ); $out->setArticleFlag( true ); if ( !$this->hookRunner->onArticleRevisionViewCustom( diff --git a/includes/page/Article.php b/includes/page/Article.php index c6ff94f24503..962990012952 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -784,7 +784,7 @@ class Article implements Page { $outputPage->setRevisionId( $this->getRevIdFetched() ); $outputPage->setRevisionIsCurrent( $rev->isCurrent() ); # Preload timestamp to avoid a DB hit - $outputPage->setRevisionTimestamp( $rev->getTimestamp() ); + $outputPage->getMetadata()->setRevisionTimestamp( $rev->getTimestamp() ); # Pages containing custom CSS or JavaScript get special treatment if ( $this->getTitle()->isSiteConfigPage() || $this->getTitle()->isUserConfigPage() ) { @@ -929,7 +929,7 @@ class Article implements Page { # Preload timestamp to avoid a DB hit $cachedTimestamp = $pOutput->getRevisionTimestamp(); if ( $cachedTimestamp !== null ) { - $outputPage->setRevisionTimestamp( $cachedTimestamp ); + $outputPage->getMetadata()->setRevisionTimestamp( $cachedTimestamp ); $this->mPage->setTimestamp( $cachedTimestamp ); } } @@ -972,7 +972,7 @@ class Article implements Page { $cachedId = $pOutput->getCacheRevisionId(); if ( $cachedId !== null ) { $outputPage->setRevisionId( $cachedId ); - $outputPage->setRevisionTimestamp( $pOutput->getTimestamp() ); + $outputPage->getMetadata()->setRevisionTimestamp( $pOutput->getTimestamp() ); } } diff --git a/tests/phpunit/includes/Output/OutputPageTest.php b/tests/phpunit/includes/Output/OutputPageTest.php index 1b6b59413436..10f871f21a76 100644 --- a/tests/phpunit/includes/Output/OutputPageTest.php +++ b/tests/phpunit/includes/Output/OutputPageTest.php @@ -1614,6 +1614,7 @@ class OutputPageTest extends MediaWikiIntegrationTestCase { } public function testRevisionTimestamp() { + $this->filterDeprecated( '/OutputPage::setRevisionTimestamp was deprecated/' ); $op = $this->newInstance(); $this->assertNull( $op->getRevisionTimestamp() ); |