From 6af49f93c14fea1a6e6a4c65cb4cf8e55ff44d0a Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sun, 22 Jul 2007 23:16:48 +0000 Subject: [PATCH] * Pass new Revision to the 'ArticleInsertComplete' and 'ArticleSaveComplete' hooks; see docs/hooks.txt for more information * Document 'ArticleInsertComplete' hook --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 24 ++++++++++++++++++++++++ includes/Article.php | 11 ++++------- languages/LanguageConverter.php | 2 +- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9c96b52588..d248b1e4f5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -153,6 +153,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Pass the user as an argument to 'isValidPassword' hook callbacks; see docs/hooks.txt for more information * Introduce 'UserGetRights' hook; see docs/hooks.txt for more information +* Pass new Revision to the 'ArticleInsertComplete' and 'ArticleSaveComplete' + hooks; see docs/hooks.txt for more information == Bugfixes since 1.10 == diff --git a/docs/hooks.txt b/docs/hooks.txt index c1c62a3ae3..95cea3dc83 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -267,6 +267,17 @@ $article: the article that was deleted $user: the user that deleted the article $reason: the reason the article was deleted +'ArticleInsertComplete': After an article is created +$article: Article created +$user: User creating the article +$text: New content +$summary: Edit summary/comment +$isMinor: Whether or not the edit was marked as minor +$isWatch: (No longer used) +$section: (No longer used) +$flags: Flags passed to Article::doEdit() +$revision: New Revision of the article + 'ArticleProtect': before an article is protected $article: the article being protected $user: the user doing the protection @@ -290,6 +301,17 @@ $isminor: minor flag $iswatch: watch flag $section: section # +'ArticleSaveComplete': After an article has been updated +$article: Article modified +$user: User performing the modification +$text: New content +$summary: Edit summary/comment +$isMinor: Whether or not the edit was marked as minor +$isWatch: (No longer used) +$section: (No longer used) +$flags: Flags passed to Article::doEdit() +$revision: New Revision of the article + 'ArticleSaveComplete': after an article is saved $article: the article (object) saved $user: the user (object) who saved the article @@ -299,6 +321,8 @@ $isminor: minor flag $iswatch: watch flag $section: section # +wfRunHooks( 'ArticleSaveComplete', array( &$this, &$wgUser, $text, $summary, $flags & EDIT_MINOR, null, null, &$flags, $revision ) ); + 'ArticleUndeleted': When one or more revisions of an article are restored $title: Title corresponding to the article restored $create: Whether or not the restoration caused the page to be created diff --git a/includes/Article.php b/includes/Article.php index 9f81294914..48422f558a 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1457,19 +1457,16 @@ class Article { # Clear caches Article::onArticleCreate( $this->mTitle ); - wfRunHooks( 'ArticleInsertComplete', array( &$this, &$wgUser, $text, - $summary, $flags & EDIT_MINOR, - null, null, &$flags ) ); + wfRunHooks( 'ArticleInsertComplete', array( &$this, &$wgUser, $text, $summary, + $flags & EDIT_MINOR, null, null, &$flags, $revision ) ); } if ( $good && !( $flags & EDIT_DEFER_UPDATES ) ) { wfDoUpdates(); } - wfRunHooks( 'ArticleSaveComplete', - array( &$this, &$wgUser, $text, - $summary, $flags & EDIT_MINOR, - null, null, &$flags ) ); + wfRunHooks( 'ArticleSaveComplete', array( &$this, &$wgUser, $text, $summary, + $flags & EDIT_MINOR, null, null, &$flags, $revision ) ); wfProfileOut( __METHOD__ ); return $good; diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 2bc047a078..43f33ae68b 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -777,7 +777,7 @@ class LanguageConverter { * MediaWiki:conversiontable* is updated * @private */ - function OnArticleSaveComplete($article, $user, $text, $summary, $isminor, $iswatch, $section) { + function OnArticleSaveComplete($article, $user, $text, $summary, $isminor, $iswatch, $section, $flags, $revision) { $titleobj = $article->getTitle(); if($titleobj->getNamespace() == NS_MEDIAWIKI) { /* -- 2.20.1