WikiPage::commitRollback - also return a RevisionRecord
Still need to return a Revision until 1.36, but the Revision returned shouldn't be used in core Bug: T251965 Change-Id: Ie227c9449da2da2fdf99d595c08e80a15a78f5d5
This commit is contained in:
parent
ad4a3ba45f
commit
fc04afa971
3 changed files with 17 additions and 9 deletions
|
|
@ -134,9 +134,9 @@ class RollbackAction extends FormAction {
|
|||
$errMsg = array_shift( $errArray );
|
||||
$this->getOutput()->addWikiMsgArray( $errMsg, $errArray );
|
||||
|
||||
if ( isset( $data['current'] ) ) {
|
||||
if ( isset( $data['current-revision-record'] ) ) {
|
||||
/** @var RevisionRecord $current */
|
||||
$current = $data['current']->getRevisionRecord();
|
||||
$current = $data['current-revision-record'];
|
||||
|
||||
if ( $current->getComment() != null ) {
|
||||
$this->getOutput()->addWikiMsg(
|
||||
|
|
@ -165,8 +165,8 @@ class RollbackAction extends FormAction {
|
|||
}
|
||||
|
||||
/** @var RevisionRecord $current */
|
||||
$current = $data['current']->getRevisionRecord();
|
||||
$target = $data['target']->getRevisionRecord();
|
||||
$current = $data['current-revision-record'];
|
||||
$target = $data['target-revision-record'];
|
||||
$newId = $data['newid'];
|
||||
$this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
|
||||
$this->getOutput()->setRobotPolicy( 'noindex,nofollow' );
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ class ApiRollback extends ApiBase {
|
|||
// Watch pages
|
||||
$this->setWatch( $watch, $titleObj, 'watchrollback' );
|
||||
|
||||
$currentRevisionRecord = $details['current']->getRevisionRecord();
|
||||
$targetRevisionRecord = $details['target']->getRevisionRecord();
|
||||
$currentRevisionRecord = $details['current-revision-record'];
|
||||
$targetRevisionRecord = $details['target-revision-record'];
|
||||
|
||||
$info = [
|
||||
'title' => $titleObj->getPrefixedText(),
|
||||
|
|
|
|||
|
|
@ -3259,7 +3259,10 @@ class WikiPage implements Page, IDBAccessObject {
|
|||
// User name given should match up with the top revision.
|
||||
// If the revision's user is not visible, then $from should be empty.
|
||||
if ( $from !== ( $currentEditorForPublic ? $currentEditorForPublic->getName() : '' ) ) {
|
||||
$resultDetails = [ 'current' => $legacyCurrent ];
|
||||
$resultDetails = [
|
||||
'current' => $legacyCurrent,
|
||||
'current-revision-record' => $current,
|
||||
];
|
||||
return [ [ 'alreadyrolled',
|
||||
htmlspecialchars( $this->mTitle->getPrefixedText() ),
|
||||
htmlspecialchars( $fromP ),
|
||||
|
|
@ -3427,7 +3430,10 @@ class WikiPage implements Page, IDBAccessObject {
|
|||
|
||||
// Report if the edit was not created because it did not change the content.
|
||||
if ( $updater->isUnchanged() ) {
|
||||
$resultDetails = [ 'current' => $legacyCurrent ];
|
||||
$resultDetails = [
|
||||
'current' => $legacyCurrent,
|
||||
'current-revision-record' => $current,
|
||||
];
|
||||
return [ [ 'alreadyrolled',
|
||||
htmlspecialchars( $this->mTitle->getPrefixedText() ),
|
||||
htmlspecialchars( $fromP ),
|
||||
|
|
@ -3453,7 +3459,7 @@ class WikiPage implements Page, IDBAccessObject {
|
|||
|
||||
$revId = $rev->getId();
|
||||
|
||||
// Soft deprecated in 1.35
|
||||
// Hard deprecated in 1.35
|
||||
$this->getHookRunner()->onArticleRollbackComplete( $this, $guser,
|
||||
$legacyTarget, $legacyCurrent );
|
||||
|
||||
|
|
@ -3462,7 +3468,9 @@ class WikiPage implements Page, IDBAccessObject {
|
|||
$resultDetails = [
|
||||
'summary' => $summary,
|
||||
'current' => $legacyCurrent,
|
||||
'current-revision-record' => $current,
|
||||
'target' => $legacyTarget,
|
||||
'target-revision-record' => $target,
|
||||
'newid' => $revId,
|
||||
'tags' => $tags
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue