*Add hook when a revision is restored (for flaggedrevs, next commit)

This commit is contained in:
Aaron Schulz 2007-12-07 22:51:00 +00:00
parent e11e222917
commit f2b99c88e0
2 changed files with 8 additions and 0 deletions

View file

@ -325,6 +325,11 @@ $moveonly: boolean whether it was for move only or not
'ArticlePurge': before executing "&action=purge"
$article: article (object) to purge
'ArticleRevisionUndeleted' after an article revision is restored
$title: the article title
$revision: the revision
$oldPageID: the page ID of the revision when archived (may be null)
'ArticleRollbackComplete': after an article rollback is completed
$article: the article that was edited
$user: the user who did the rollback

View file

@ -432,6 +432,7 @@ class PageArchive {
'ar_minor_edit',
'ar_flags',
'ar_text_id',
'ar_page_id',
'ar_len' ),
/* WHERE */ array(
'ar_namespace' => $this->title->getNamespace(),
@ -476,6 +477,8 @@ class PageArchive {
) );
$revision->insertOn( $dbw );
$restored++;
wfRunHooks( 'ArticleRevisionUndeleted', array( &$this->title, $revision, $row->ar_page_id ) );
}
// Was anything restored at all?
if($restored == 0)