* Pass new Revision to the 'ArticleInsertComplete' and 'ArticleSaveComplete' hooks...
authorRob Church <robchurch@users.mediawiki.org>
Sun, 22 Jul 2007 23:16:48 +0000 (23:16 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sun, 22 Jul 2007 23:16:48 +0000 (23:16 +0000)
* Document 'ArticleInsertComplete' hook

RELEASE-NOTES
docs/hooks.txt
includes/Article.php
languages/LanguageConverter.php

index 9c96b52..d248b1e 100644 (file)
@@ -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 ==
 
index c1c62a3..95cea3d 100644 (file)
@@ -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
index 9f81294..48422f5 100644 (file)
@@ -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;
index 2bc047a..43f33ae 100644 (file)
@@ -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) {
             /*