]> git.somenet.org - pub/jan/mw_mm_webhook_extension.git/commitdiff
Mediawiki version update master
authorSomeone <someone@somenet.org>
Tue, 27 Sep 2022 16:45:45 +0000 (18:45 +0200)
committerSomeone <someone@somenet.org>
Tue, 27 Sep 2022 16:45:45 +0000 (18:45 +0200)
MMNotifyCore.php
extension.json

index ac05afa351fe1c1f8fff8bf3d2cd85cdd2bd335c..7bebd041d9cfffabe1d4b5b607dcc00d00e305a1 100644 (file)
@@ -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';
index 386fe897c047b08a3e9ba6326a7b6fa556d9ca57..241ec59fe76e399b3b3d15e5ba1423ffd0c7a28b 100644 (file)
@@ -14,9 +14,9 @@
         ]
     },
     "Hooks": {
-        "PageContentInsertComplete": [
+        "PageSaveComplete": [
             [
-                "MMNotify::onPageContentInsertComplete"
+                "MMNotify::onPageSaveComplete"
             ]
         ]
     },