diff options
author | C. Scott Ananian <cscott@cscott.net> | 2025-03-24 23:29:14 -0400 |
---|---|---|
committer | C. Scott Ananian <cscott@cscott.net> | 2025-04-04 11:44:48 -0400 |
commit | eee914b78f9320391e9b9532ac821e0fddfef0c7 (patch) | |
tree | 06b50e1ce5f90efbdc7944201cdaa59a5de2bf1a | |
parent | 3bf97e3b223fd44ac092a4fc9d462bd65cbc6b71 (diff) | |
download | mediawikicore-eee914b78f9320391e9b9532ac821e0fddfef0c7.tar.gz mediawikicore-eee914b78f9320391e9b9532ac821e0fddfef0c7.zip |
Hard deprecate OutputPage::setRevisionTimestamp()
This method was already deprecated, and mentioned in the RELEASE-NOTES.
This patch just removes use of the method in core; it does not
seem to be used outside core:
https://codesearch.wmcloud.org/deployed/?q=-%3EsetRevisionTimestamp%5C%28
Bug: T301020
Follows-Up: Iee09b1591bfa11142686c9043a8294e7e77d2b61
Change-Id: I7528b9bc3522ed05f41f0915e38940b4a1fd48ce
-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() ); |