Clean up Title deprecated methods

Replace hard deprecated getPreviousRevisionID method with RevisionLookup::getPreviousRevision method

Bug: T274151
Change-Id: Ia6ec1a4765ba5849b53919a6e9d73df7e839f6ed
This commit is contained in:
vladshapik 2021-02-10 22:33:05 +02:00
parent 9ac3c667ba
commit aac1986c3b

View file

@ -1,5 +1,7 @@
<?php
use MediaWiki\MediaWikiServices;
class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
/**
@ -106,7 +108,12 @@ class EchoEditUserTalkPresentationModel extends EchoEventPresentationModel {
private function getRevBeforeFirstNotification() {
$events = $this->getBundledEvents();
$firstNotificationRevId = end( $events )->getExtraParam( 'revid' );
return $this->event->getTitle()->getPreviousRevisionID( $firstNotificationRevId );
$revisionLookup = MediaWikiServices::getInstance()->getRevisionLookup();
$revisionRecord = $revisionLookup->getRevisionById( $firstNotificationRevId );
$previousRevision = $revisionRecord ? $revisionLookup->getPreviousRevision( $revisionRecord ) : null;
$oldRevisionID = $previousRevision ? $previousRevision->getId() : 0;
return $oldRevisionID;
}
protected function getSubjectMessageKey() {