From 66cc926a5d5244919eb202012ae6304b3a1402e6 Mon Sep 17 00:00:00 2001 From: Bertrand Gorge Date: Mon, 27 Jun 2022 19:24:56 +0200 Subject: [PATCH] Fixed issue #60: replaced deprecated method doEditContent with PageUpdater::saveRevision --- includes/Extension.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/Extension.php b/includes/Extension.php index 63ff418..35545bf 100644 --- a/includes/Extension.php +++ b/includes/Extension.php @@ -107,12 +107,12 @@ class Extension { $result = $linker->linkContent( $source ); if ( $result ) { $content = $source->getContent()->getContentHandler()->unserializeContent( $result ); - $source->getPage()->doEditContent( - $content, - \wfMessage( 'linktitles-bot-comment', self::URL ), - EDIT_MINOR | EDIT_FORCE_BOT, - false, // baseRevId - $context->getUser() + + $updater = $source->getPage()->newPageUpdater( $context->getUser()); + $updater->setContent( SlotRecord::MAIN, $content ); + $updater->saveRevision( + CommentStoreComment::newUnsavedComment(\wfMessage( 'linktitles-bot-comment', self::URL )), + EDIT_MINOR | EDIT_FORCE_BOT ); }; return true;