EditPage::edit - remove use of Revision objects
Remove use of ::newFromId, ::getPrevious, and ::getContentModel Bug: T251073 Bug: T250981 Bug: T249021 Change-Id: I634b371d20cdf1a42ca3be77550717884f988d23
This commit is contained in:
parent
d535ebeb51
commit
68ca964f56
1 changed files with 14 additions and 4 deletions
|
|
@ -692,12 +692,22 @@ class EditPage {
|
|||
if ( $revContentModel && $revContentModel !== $this->contentModel ) {
|
||||
$prevRev = null;
|
||||
if ( $this->undidRev ) {
|
||||
$undidRevObj = Revision::newFromId( $this->undidRev );
|
||||
$prevRev = $undidRevObj ? $undidRevObj->getPrevious() : null;
|
||||
$undidRevRecord = $this->revisionStore
|
||||
->getRevisionById( $this->undidRev );
|
||||
$prevRevRecord = $undidRevRecord ?
|
||||
$this->revisionStore->getPreviousRevision( $undidRevRecord ) :
|
||||
null;
|
||||
|
||||
$prevContentModel = $prevRevRecord ?
|
||||
$prevRevRecord
|
||||
->getSlot( SlotRecord::MAIN, RevisionRecord::RAW )
|
||||
->getModel() :
|
||||
'';
|
||||
}
|
||||
|
||||
if ( !$this->undidRev
|
||||
|| !$prevRev
|
||||
|| $prevRev->getContentModel() !== $this->contentModel
|
||||
|| !$prevRevRecord
|
||||
|| $prevContentModel !== $this->contentModel
|
||||
) {
|
||||
$this->displayViewSourcePage(
|
||||
$this->getContentObject(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue