From: Someone Date: Tue, 27 Sep 2022 16:45:45 +0000 (+0200) Subject: Mediawiki version update X-Git-Url: https://git.somenet.org/pub/jan/mw_mm_webhook_extension.git/commitdiff_plain Mediawiki version update --- diff --git a/MMNotifyCore.php b/MMNotifyCore.php index ac05afa..7bebd04 100644 --- a/MMNotifyCore.php +++ b/MMNotifyCore.php @@ -9,15 +9,17 @@ * @license MIT */ +use MediaWiki\Revision\RevisionRecord; + class MMNotify{ /** * Occurs after a new article has been created. * @see http://www.mediawiki.org/wiki/Manual:Hooks/ArticleInsertComplete */ - static function onPageContentInsertComplete(WikiPage $wikiPage, $user, $text, $summary, $isminor, $iswatch, $section, $flags, $revision){ + static function onPageSaveComplete($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult){ if (stripos($wikiPage->getTitle()->getText(), 'FSPlenum') === false) return; - $text = ContentHandler::getContentText($wikiPage->getRevision()->getContent( Revision::RAW)); + $text = ContentHandler::getContentText($revisionRecord->getContent(($revisionRecord->getSlotRoles())[0], RevisionRecord::RAW )); preg_match_all('/^={1,4}[^=].*$/m', $text, $out); $post = '\n'; diff --git a/extension.json b/extension.json index 386fe89..241ec59 100644 --- a/extension.json +++ b/extension.json @@ -14,9 +14,9 @@ ] }, "Hooks": { - "PageContentInsertComplete": [ + "PageSaveComplete": [ [ - "MMNotify::onPageContentInsertComplete" + "MMNotify::onPageSaveComplete" ] ] },