Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312106

Change subject: Replace Article::doEdit()
......................................................................

Replace Article::doEdit()

Bug: T145736
Change-Id: I40ee66617cbd3e140b8cf76d2843bfccfdff146d
---
M maintenance/RenameCategories.php
M maintenance/massedit.php
M maintenance/relocalizeWiki.php
3 files changed, 21 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation 
refs/changes/06/312106/1

diff --git a/maintenance/RenameCategories.php b/maintenance/RenameCategories.php
index dffa543..0d01364 100644
--- a/maintenance/RenameCategories.php
+++ b/maintenance/RenameCategories.php
@@ -278,11 +278,14 @@
                }
 
                // Actual modification
-               $success = $article->doEdit( $text, $summary,
+               $success = $article->doEditContent(
+                       ContentHandler::makeContent( $text, $title ),
+                       $summary,
                        ( $minor ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 ) |
                        ( $autoSummary ? EDIT_AUTOSUMMARY : 0 ) |
-                       ( $noRC ? EDIT_SUPPRESS_RC : 0 ) );
+                       ( $noRC ? EDIT_SUPPRESS_RC : 0 )
+               );
                if ( $success ) {
                        print "done\n";
                } else {
@@ -356,11 +359,14 @@
                if (!$testing) {
                        $newtitle = Title::newFromText($newtitletext, 
NS_CATEGORY);
                        $newarticle = new Article($newtitle);
-                       $savestat = $newarticle->doEdit( $oldarticlecontent, 
$summary,
+                       $savestat = $newarticle->doEdit(
+                               ContentHandler::makeContent( 
$oldarticlecontent, $newtitle ),
+                               $summary,
                                        ( $minor ? EDIT_MINOR : 0 ) |
                                        ( $bot ? EDIT_FORCE_BOT : 0 ) |
                                        ( $autoSummary ? EDIT_AUTOSUMMARY : 0 ) 
|
-                                       ( $noRC ? EDIT_SUPPRESS_RC : 0 ) );
+                                       ( $noRC ? EDIT_SUPPRESS_RC : 0 )
+                       );
                        if ($savestat->isGood()) echo "moved successfully\n";
                        else echo "failed moving\n";
                        /*
diff --git a/maintenance/massedit.php b/maintenance/massedit.php
index bfbe608..9bb5b4d 100644
--- a/maintenance/massedit.php
+++ b/maintenance/massedit.php
@@ -201,11 +201,14 @@
                }
 
                // Actual modification
-               $success = $article->doEdit( $text, $summary,
+               $success = $article->doEditContent(
+                       ContentHandler::makeContent( $text, $title ),
+                       $summary,
                        ( $minor ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 ) |
                        ( $autoSummary ? EDIT_AUTOSUMMARY : 0 ) |
-                       ( $noRC ? EDIT_SUPPRESS_RC : 0 ) );
+                       ( $noRC ? EDIT_SUPPRESS_RC : 0 )
+               );
                if ( $success ) {
                        print "done\n";
                } else {
diff --git a/maintenance/relocalizeWiki.php b/maintenance/relocalizeWiki.php
index 1bd8ac3..2f24e42 100644
--- a/maintenance/relocalizeWiki.php
+++ b/maintenance/relocalizeWiki.php
@@ -124,7 +124,12 @@
 
                        if( $this->bEdited ) {
                                if( !$this->bDryRun ) {
-                                       $oArticle->doEdit( $sArticleContent, 
'/* Changed Localisation */', EDIT_FORCE_BOT | EDIT_MINOR | EDIT_SUPPRESS_RC );
+                                       $oArticle->doEditContent(
+                                               ContentHandler::makeContent( 
$sArticleContent, $oArticle->getTitle() ),
+                                               $sArticleContent,
+                                               '/* Changed Localisation */',
+                                               EDIT_FORCE_BOT | EDIT_MINOR | 
EDIT_SUPPRESS_RC
+                                       );
                                }
                                $this->sOutput .=  "Replacement done.\n\n";
                        } else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40ee66617cbd3e140b8cf76d2843bfccfdff146d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>

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

Reply via email to