Replace usage of doEdit() with doEditContent()
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 28 Aug 2012 14:02:13 +0000 (16:02 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 28 Aug 2012 14:53:19 +0000 (16:53 +0200)
Change-Id: I2c423744bd91044c37bbec53b35729bd1c09901b

docs/hooks.txt
includes/filerepo/file/LocalFile.php
includes/installer/Installer.php
maintenance/edit.php
maintenance/importSiteScripts.php
maintenance/importTextFile.php

index 1d45510..5fe3cf0 100644 (file)
@@ -478,7 +478,7 @@ $summary: Edit summary/comment
 $isMinor: Whether or not the edit was marked as minor
 $isWatch: (No longer used)
 $section: (No longer used)
-$flags: Flags passed to Article::doEdit()
+$flags: Flags passed to WikiPage::doEditContent()
 $revision: New Revision of the article
 
 'ArticleContentInsertComplete': After a new article is created
@@ -489,7 +489,7 @@ $summary: Edit summary/comment
 $isMinor: Whether or not the edit was marked as minor
 $isWatch: (No longer used)
 $section: (No longer used)
-$flags: Flags passed to Article::doEdit()
+$flags: Flags passed to WikiPage::doEditContent()
 $revision: New Revision of the article
 
 'ArticleMergeComplete': after merging to article using Special:Mergehistory
@@ -566,9 +566,9 @@ $summary: Edit summary/comment
 $isMinor: Whether or not the edit was marked as minor
 $isWatch: (No longer used)
 $section: (No longer used)
-$flags: Flags passed to Article::doEdit()
+$flags: Flags passed to WikiPage::doEditContent()
 $revision: New Revision of the article
-$status: Status object about to be returned by doEdit()
+$status: Status object about to be returned by doEditContent()
 $baseRevId: the rev ID (or false) this edit was based on
 
 'ArticleContentSaveComplete': After an article has been updated
@@ -579,9 +579,9 @@ $summary: Edit summary/comment
 $isMinor: Whether or not the edit was marked as minor
 $isWatch: (No longer used)
 $section: (No longer used)
-$flags: Flags passed to Article::doEdit()
+$flags: Flags passed to WikiPage::doEditContent()
 $revision: New Revision of the article
-$status: Status object about to be returned by doEdit()
+$status: Status object about to be returned by doEditContent()
 $baseRevId: the rev ID (or false) this edit was based on
 
 'ArticleUndelete': When one or more revisions of an article are restored
@@ -860,7 +860,7 @@ pages
 $editPage: EditPage    object
 
 'EditPage::attemptSave': called before an article is
-saved, that is before Article::doEdit() is called
+saved, that is before WikiPage::doEditContent() is called
 $editpage_Obj: the current EditPage object
 
 'EditPage::importFormData': allow extensions to read additional data
index 5a55e43..7f97a98 100644 (file)
@@ -1175,8 +1175,9 @@ class LocalFile extends File {
                } else {
                        # New file; create the description page.
                        # There's already a log entry, so don't make a second RC entry
-                       # Squid and file cache for the description page are purged by doEdit.
-                       $wikiPage->doEdit( $pageText, $comment, EDIT_NEW | EDIT_SUPPRESS_RC, false, $user );
+                       # Squid and file cache for the description page are purged by doEditContent.
+                       $content = ContentHandler::makeContent( $pageText, $descTitle );
+                       $wikiPage->doEditContent( $content, $comment, EDIT_NEW | EDIT_SUPPRESS_RC, false, $user );
                }
                wfProfileOut( __METHOD__ . '-edit' );
 
index d87f294..bac85cd 100644 (file)
@@ -1585,8 +1585,12 @@ abstract class Installer {
                $status = Status::newGood();
                try {
                        $page = WikiPage::factory( Title::newMainPage() );
-                       $page->doEdit( wfMsgForContent( 'mainpagetext' ) . "\n\n" .
-                                                       wfMsgForContent( 'mainpagedocfooter' ),
+                       $content = new WikitextContent (
+                               wfMsgForContent( 'mainpagetext' ) . "\n\n" .
+                               wfMsgForContent( 'mainpagedocfooter' )
+                       );
+
+                       $page->doEditContent( $content,
                                                        '',
                                                        EDIT_NEW,
                                                        false,
index 13b3c49..70c834c 100644 (file)
@@ -68,10 +68,11 @@ class EditCLI extends Maintenance {
 
                # Read the text
                $text = $this->getStdin( Maintenance::STDIN_ALL );
+               $content = ContentHandler::makeContent( $text, $wgTitle );
 
                # Do the edit
                $this->output( "Saving... " );
-               $status = $page->doEdit( $text, $summary,
+               $status = $page->doEditContent( $content, $summary,
                        ( $minor ? EDIT_MINOR : 0 ) |
                        ( $bot ? EDIT_FORCE_BOT : 0 ) |
                        ( $autoSummary ? EDIT_AUTOSUMMARY : 0 ) |
index b4a1bac..23a86f4 100644 (file)
@@ -65,7 +65,8 @@ class ImportSiteScripts extends Maintenance {
                        $text = Http::get( $url );
 
                        $wikiPage = WikiPage::factory( $title );
-                       $wikiPage->doEdit( $text, "Importing from $url", 0, false, $user );
+                       $content = ContentHandler::makeContent( $text, $wikiPage->getTitle() );
+                       $wikiPage->doEditContent( $content, "Importing from $url", 0, false, $user );
                }
 
        }
index 5623fb0..d6805b7 100644 (file)
@@ -56,7 +56,8 @@ if ( count( $args ) < 1 || isset( $options['help'] ) ) {
 
                                        echo( "\nPerforming edit..." );
                                        $page = WikiPage::factory( $title );
-                                       $page->doEdit( $text, $comment, $flags, false, $user );
+                                       $content = ContentHandler::makeContent( $text, $title );
+                                       $page->doEditContent( $content, $comment, $flags, false, $user );
                                        echo( "done.\n" );
 
                                } else {