From 1a45b1409c26629b7aee79facae138ae29052dc7 Mon Sep 17 00:00:00 2001 From: Ammar Abdulhamid Date: Wed, 29 Jul 2020 16:08:13 +0100 Subject: [PATCH] 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 --- includes/Skins/SkinMinerva.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/Skins/SkinMinerva.php b/includes/Skins/SkinMinerva.php index 4803cc1a9..ab152024e 100644 --- a/includes/Skins/SkinMinerva.php +++ b/includes/Skins/SkinMinerva.php @@ -399,14 +399,15 @@ class SkinMinerva extends SkinTemplate { * @return array */ 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) - $timestamp = $this->getOutput()->getRevisionTimestamp(); + $timestamp = $out->getRevisionTimestamp(); # No cached timestamp, load it from the database if ( $timestamp === null ) { $timestamp = MediaWikiServices::getInstance() ->getRevisionLookup() - ->getTimestampFromId( $this->getOutput()->getRevisionId() ); + ->getTimestampFromId( $out->getRevisionId() ); } return !$isLatestRevision || $title->isMainPage() ? @@ -512,7 +513,7 @@ class SkinMinerva extends SkinTemplate { $this->skinOptions->get( SkinOptions::SIMPLIFIED_TALK ) && // 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). - $this->getRevisionId() === $title->getLatestRevID() && + $this->getOutput()->getRevisionId() === $title->getLatestRevID() && $title->getContentModel() === CONTENT_MODEL_WIKITEXT; }