Remove usage of deprecated Skin::getRevisionId()

OutputPage has similar method and they are being used
interchangeably here. Let's stick with one.

Bug: T257992
Change-Id: Ia5a0fbf114f6a1fec6fb85e01a408edae8a5badb
This commit is contained in:
Ammar Abdulhamid 2020-07-29 16:08:13 +01:00
parent b5a3fa1452
commit 1a45b1409c

View file

@ -399,14 +399,15 @@ class SkinMinerva extends SkinTemplate {
* @return array * @return array
*/ */
protected function getHistoryLink( Title $title ) { protected function getHistoryLink( Title $title ) {
$isLatestRevision = $this->getRevisionId() === $title->getLatestRevID(); $out = $this->getOutput();
$isLatestRevision = $out->getRevisionId() === $title->getLatestRevID();
// Get rev_timestamp of current revision (preloaded by MediaWiki core) // Get rev_timestamp of current revision (preloaded by MediaWiki core)
$timestamp = $this->getOutput()->getRevisionTimestamp(); $timestamp = $out->getRevisionTimestamp();
# No cached timestamp, load it from the database # No cached timestamp, load it from the database
if ( $timestamp === null ) { if ( $timestamp === null ) {
$timestamp = MediaWikiServices::getInstance() $timestamp = MediaWikiServices::getInstance()
->getRevisionLookup() ->getRevisionLookup()
->getTimestampFromId( $this->getOutput()->getRevisionId() ); ->getTimestampFromId( $out->getRevisionId() );
} }
return !$isLatestRevision || $title->isMainPage() ? return !$isLatestRevision || $title->isMainPage() ?
@ -512,7 +513,7 @@ class SkinMinerva extends SkinTemplate {
$this->skinOptions->get( SkinOptions::SIMPLIFIED_TALK ) && $this->skinOptions->get( SkinOptions::SIMPLIFIED_TALK ) &&
// Only if viewing the latest revision, as we can't get the section numbers otherwise // Only if viewing the latest revision, as we can't get the section numbers otherwise
// (and even if we could, they would be useless, because edits often add and remove sections). // (and even if we could, they would be useless, because edits often add and remove sections).
$this->getRevisionId() === $title->getLatestRevID() && $this->getOutput()->getRevisionId() === $title->getLatestRevID() &&
$title->getContentModel() === CONTENT_MODEL_WIKITEXT; $title->getContentModel() === CONTENT_MODEL_WIKITEXT;
} }