From 225a05561b7c8be70cb1322896d16d7f64543cd0 Mon Sep 17 00:00:00 2001 From: paladox Date: Sat, 28 Dec 2019 20:52:07 +0000 Subject: [PATCH] Make onDiscordArticleInserted a static function (#60) extension.json#hooks calls onDiscordArticleInserted as a static function thus you get: ErrorException from line 174 of /srv/mediawiki/w/includes/Hooks.php: PHP Deprecated: Non-static method DiscordNotificationsCore::onDiscordArticleInserted() should not be called statically --- DiscordNotificationsCore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DiscordNotificationsCore.php b/DiscordNotificationsCore.php index b751207..5d8ee6f 100644 --- a/DiscordNotificationsCore.php +++ b/DiscordNotificationsCore.php @@ -143,7 +143,7 @@ public static function onDiscordArticleSaved( WikiPage $article, $user, $content * Occurs after a new article has been created. * @see http://www.mediawiki.org/wiki/Manual:Hooks/ArticleInsertComplete */ - public function onDiscordArticleInserted( WikiPage $article, $user, $text, $summary, $isminor, $iswatch, $section, $flags, $revision ) { + public static function onDiscordArticleInserted( WikiPage $article, $user, $text, $summary, $isminor, $iswatch, $section, $flags, $revision ) { global $wgDiscordNotificationAddedArticle, $wgDiscordIncludeDiffSize; if ( !$wgDiscordNotificationAddedArticle ) return;