Georggi199 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328877 )

Change subject: Removed deprecated hook usage
......................................................................

Removed deprecated hook usage

Bug: T151973
Change-Id: Ie5d7761bc4dda55b2d9698f1beb4def3fb65d671
---
M PageCreationNotif.hooks.php
M PageCreationNotif.php
M includes/PageCreationNotifEmailer.php
3 files changed, 21 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageCreationNotif 
refs/changes/77/328877/1

diff --git a/PageCreationNotif.hooks.php b/PageCreationNotif.hooks.php
index 20a0e9c..7286ceb 100644
--- a/PageCreationNotif.hooks.php
+++ b/PageCreationNotif.hooks.php
@@ -89,13 +89,24 @@
        }
 
        /**
-        * Called just after a new Article is created.
+        * Called just after a new WikiPage is created.
         *
+        * @param WikiPage $wikiPage
+        * @param User $user
+        * @param Content $content
+        * @param string $summary
+        * @param bool $isMinor
+        * @param $isWatch
+        * @param $section
+        * @param $flags
+        * @param Revision $revision
+        *
+        * @return bool
         * @since 0.1
         */
-       public static function onArticleInsertComplete( &$article, User &$user, 
$text, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, Revision 
-       $revision ) {
-               PageCreationNotifEmailer::notifyOnNewArticle( $article, $user );
+       public static function onPageContentInsertComplete( $wikiPage, $user, 
$content, $summary, $isMinor,
+               $isWatch, $section, $flags, $revision ) {
+               PageCreationNotifEmailer::notifyOnNewWikiPage( $wikiPage, $user 
);
 
                return true;
        }
diff --git a/PageCreationNotif.php b/PageCreationNotif.php
index 256bb5f..9858a65 100644
--- a/PageCreationNotif.php
+++ b/PageCreationNotif.php
@@ -37,7 +37,7 @@
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'PageCreationNotifHooks::onSchemaUpdate';
 $wgHooks['GetPreferences'][] = 'PageCreationNotifHooks::onGetPreferences';
 $wgHooks['UserSaveOptions'][] = 'PageCreationNotifHooks::onUserSaveOptions';
-$wgHooks['ArticleInsertComplete'][] = 
'PageCreationNotifHooks::onArticleInsertComplete';
+$wgHooks['PageContentInsertComplete'][] = 
'PageCreationNotifHooks::onPageContentInsertComplete';
 
 /**
  * Email address to use as the sender
diff --git a/includes/PageCreationNotifEmailer.php 
b/includes/PageCreationNotifEmailer.php
index e72a36b..0f20c7d 100644
--- a/includes/PageCreationNotifEmailer.php
+++ b/includes/PageCreationNotifEmailer.php
@@ -20,7 +20,7 @@
         * @since 0.1
         *
         */
-       public static function notifyOnNewArticle( $article, $creator ) {
+       public static function notifyOnNewWikiPage( $wikiPage, $creator ) {
                global $wgPCNSender, $wgPCNSenderName;
 
                $users = self::getNotifUsers();
@@ -33,7 +33,7 @@
 
                        $subject = wfMessage(
                                'page-creation-email-subject',
-                               $article->getTitle()->getFullText(),
+                               $wikiPage->getTitle()->getFullText(),
                                $GLOBALS['wgSitename'],
                                $creator->getName()
                        )->parse();
@@ -41,10 +41,10 @@
                        $emailText = wfMessage(
                                'page-creation-email-body',
                                $user->getName(),
-                               $article->getTitle()->getFullText(),
+                               $wikiPage->getTitle()->getFullText(),
                                $creator->getName(),
-                               $article->getTitle()->getFullURL(),
-                               $article->getText()
+                               $wikiPage->getTitle()->getFullURL(),
+                               ContentHandler::getContentText( 
$wikiPage->getContent() )
                        )->parse();
 
                        UserMailer::send(

-- 
To view, visit https://gerrit.wikimedia.org/r/328877
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5d7761bc4dda55b2d9698f1beb4def3fb65d671
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageCreationNotif
Gerrit-Branch: master
Gerrit-Owner: Georggi199 <bmp2...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to