* Use WikiPage instead of Article since we only need to call doEdit()
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 1 Nov 2011 16:41:36 +0000 (16:41 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 1 Nov 2011 16:41:36 +0000 (16:41 +0000)
* Pass the User object to doEdit() in addition to the override of $wgUser

includes/job/DoubleRedirectJob.php

index ce3d8bb..f991883 100644 (file)
@@ -125,10 +125,10 @@ class DoubleRedirectJob extends Job {
                global $wgUser;
                $oldUser = $wgUser;
                $wgUser = $this->getUser();
-               $article = new Article( $this->title );
+               $article = WikiPage::factory( $this->title );
                $reason = wfMsgForContent( 'double-redirect-fixed-' . $this->reason,
                        $this->redirTitle->getPrefixedText(), $newTitle->getPrefixedText() );
-               $article->doEdit( $newText, $reason, EDIT_UPDATE | EDIT_SUPPRESS_RC );
+               $article->doEdit( $newText, $reason, EDIT_UPDATE | EDIT_SUPPRESS_RC, false, $this->getUser() );
                $wgUser = $oldUser;
 
                return true;