This passes the id of the revision that was undone to the
PageContentSaveComplete hook, since this hook is now inside a deferred
update so extensions can no longer rely on 'wpUndidRevision' being
present in the request.
Change-Id: I50dcb841cd0616acc2d69c3a685ba3cb339986c3
$revision: New Revision of the article
$status: Status object about to be returned by doEditContent()
$baseRevId: the rev ID (or false) this edit was based on
$revision: New Revision of the article
$status: Status object about to be returned by doEditContent()
$baseRevId: the rev ID (or false) this edit was based on
+$undidRevId: the rev ID (or 0) this edit undid
'ArticleUndelete': When one or more revisions of an article are restored.
&$title: Title corresponding to the article restored
'ArticleUndelete': When one or more revisions of an article are restored.
&$title: Title corresponding to the article restored
nothing)
$status: Status object about to be returned by doEditContent()
$baseRevId: the rev ID (or false) this edit was based on
nothing)
$status: Status object about to be returned by doEditContent()
$baseRevId: the rev ID (or false) this edit was based on
+$undidRevId: the rev ID (or 0) this edit undid
'PageHistoryBeforeList': When a history page list is about to be constructed.
&$article: the article that the history is loading for
'PageHistoryBeforeList': When a history page list is about to be constructed.
&$article: the article that the history is loading for
false,
$wgUser,
$content->getDefaultFormat(),
false,
$wgUser,
$content->getDefaultFormat(),
+ $this->changeTags,
+ $this->undidRev
);
if ( !$doEditStatus->isOK() ) {
);
if ( !$doEditStatus->isOK() ) {
* @param array|null $tags Change tags to apply to this edit
* Callers are responsible for permission checks
* (with ChangeTags::canAddTagsAccompanyingChange)
* @param array|null $tags Change tags to apply to this edit
* Callers are responsible for permission checks
* (with ChangeTags::canAddTagsAccompanyingChange)
+ * @param Int $undidRevId Id of revision that was undone or 0
*
* @throws MWException
* @return Status Possible errors:
*
* @throws MWException
* @return Status Possible errors:
*/
public function doEditContent(
Content $content, $summary, $flags = 0, $baseRevId = false,
*/
public function doEditContent(
Content $content, $summary, $flags = 0, $baseRevId = false,
- User $user = null, $serialFormat = null, $tags = []
+ User $user = null, $serialFormat = null, $tags = [], $undidRevId = 0
) {
global $wgUser, $wgUseAutomaticEditSummaries;
) {
global $wgUser, $wgUseAutomaticEditSummaries;
'oldId' => $this->getLatest(),
'oldIsRedirect' => $this->isRedirect(),
'oldCountable' => $this->isCountable(),
'oldId' => $this->getLatest(),
'oldIsRedirect' => $this->isRedirect(),
'oldCountable' => $this->isCountable(),
- 'tags' => ( $tags !== null ) ? (array)$tags : []
+ 'tags' => ( $tags !== null ) ? (array)$tags : [],
+ 'undidRevId' => $undidRevId
];
// Actually create the revision and create/update the page
];
// Actually create the revision and create/update the page
);
// Trigger post-save hook
$params = [ &$this, &$user, $content, $summary, $flags & EDIT_MINOR,
);
// Trigger post-save hook
$params = [ &$this, &$user, $content, $summary, $flags & EDIT_MINOR,
- null, null, &$flags, $revision, &$status, $meta['baseRevId'] ];
+ null, null, &$flags, $revision, &$status, $meta['baseRevId'],
+ $meta['undidRevId'] ];
ContentHandler::runLegacyHooks( 'ArticleSaveComplete', $params );
Hooks::run( 'PageContentSaveComplete', $params );
}
ContentHandler::runLegacyHooks( 'ArticleSaveComplete', $params );
Hooks::run( 'PageContentSaveComplete', $params );
}