Reedy has uploaded a new change for review.

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

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

Replace Article::doEdit()

Bug: T145736
Change-Id: I3b5e4d0a720484e508e98e2d81c5d5075eed10d8
---
M classes/Thread.php
M classes/Threads.php
M import/import-parsed-discussions.php
3 files changed, 25 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/95/312095/1

diff --git a/classes/Thread.php b/classes/Thread.php
index b8bf190..915d742 100644
--- a/classes/Thread.php
+++ b/classes/Thread.php
@@ -439,7 +439,11 @@
                // Make the article edit.
                $traceTitle = Threads::newThreadTitle( $this->subject(), new 
Article( $oldTitle, 0 ) );
                $redirectArticle = new Article( $traceTitle, 0 );
-               $redirectArticle->doEdit( $redirectText, $reason, EDIT_NEW | 
EDIT_SUPPRESS_RC );
+
+               $redirectArticle->doEditContent(
+                       ContentHandler::makeContent( $redirectText, $traceTitle 
),
+                       $reason, EDIT_NEW | EDIT_SUPPRESS_RC
+               );
 
                // Add the trace thread to the tracking table.
                $thread = Thread::create( $redirectArticle, new Article( 
$oldTitle, 0 ), null,
diff --git a/classes/Threads.php b/classes/Threads.php
index 0d270af..f535823 100644
--- a/classes/Threads.php
+++ b/classes/Threads.php
@@ -62,8 +62,9 @@
        public static function createTalkpageIfNeeded( $talkpage ) {
                if ( !$talkpage->exists() ) {
                        try {
-                               $talkpage->doEdit(
-                                       "",
+
+                               $talkpage->doEditContent(
+                                       ContentHandler::makeContent( "", 
$talkpage->getTitle() ),
                                        wfMessage( 
'lqt_talkpage_autocreate_summary' )->inContentLanguage()->text(),
                                        EDIT_NEW | EDIT_SUPPRESS_RC
                                );
diff --git a/import/import-parsed-discussions.php 
b/import/import-parsed-discussions.php
index a327488..3011668 100644
--- a/import/import-parsed-discussions.php
+++ b/import/import-parsed-discussions.php
@@ -78,10 +78,24 @@
        print "Creating thread $title as a subthread of " . ( $super ? 
$super->title() : 'none' ) . "\n";
 
        $root = new Article( $title, 0 );
-       $root->doEdit( $info['content'], 'Imported from JSON', EDIT_NEW, false, 
$user );
 
-       $t = LqtView::postEditUpdates( $super ? 'reply' : 'new', $super, $root, 
$article,
-                                                                       
$subject, 'Imported from JSON', null );
+       $root->doEdit(
+               ContentHandler::makeContent( $info['content'], $title ),
+               'Imported from JSON',
+               EDIT_NEW,
+               false,
+               $user
+       );
+
+       $t = LqtView::postEditUpdates(
+               $super ? 'reply' : 'new',
+               $super,
+               $root,
+               $article,
+               $subject,
+               'Imported from JSON',
+               null
+       );
 
        $t = Threads::withId( $t->id() ); // Some weirdness.
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b5e4d0a720484e508e98e2d81c5d5075eed10d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
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