Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -1040,7 +1040,8 @@ |
1041 | 1041 | } |
1042 | 1042 | |
1043 | 1043 | $art = new Article( $title ); |
1044 | | - $art->insertNewArticle( $text, '', false, false ); |
| 1044 | + $art->doEdit( $text, '', EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, |
| 1045 | + false, null, false, false, '', true ); |
1045 | 1046 | |
1046 | 1047 | $this->teardownGlobals(); |
1047 | 1048 | } |
Index: trunk/phase3/maintenance/addwiki.php |
— | — | @@ -130,7 +130,8 @@ |
131 | 131 | $wgArticle = new Article( $wgTitle ); |
132 | 132 | $ucsite = ucfirst( $site ); |
133 | 133 | |
134 | | - $wgArticle->insertNewArticle( $this->getFirstArticle( $ucsite, $name ), '', false, false ); |
| 134 | + $wgArticle->doEdit( $this->getFirstArticle( $ucsite, $name ), '', EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, |
| 135 | + false, null, false, false, '', true ); |
135 | 136 | |
136 | 137 | $this->output( "Adding to dblists\n" ); |
137 | 138 | |
Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -653,7 +653,7 @@ |
654 | 654 | $editPage: EditPage object |
655 | 655 | |
656 | 656 | 'EditPage::attemptSave': called before an article is |
657 | | -saved, that is before insertNewArticle() is called |
| 657 | +saved, that is before Article::doEdit() is called |
658 | 658 | $editpage_Obj: the current EditPage object |
659 | 659 | |
660 | 660 | 'EditPage::importFormData': allow extensions to read additional data |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1965,6 +1965,7 @@ |
1966 | 1966 | * it. Nevertheless, use Article::doEdit() instead. |
1967 | 1967 | */ |
1968 | 1968 | function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC = false, $comment = false, $bot = false ) { |
| 1969 | + wfDeprecated( __METHOD__ ); |
1969 | 1970 | $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | |
1970 | 1971 | ( $isminor ? EDIT_MINOR : 0 ) | |
1971 | 1972 | ( $suppressRC ? EDIT_SUPPRESS_RC : 0 ) | |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -905,10 +905,11 @@ |
906 | 906 | |
907 | 907 | $isComment = ( $this->section == 'new' ); |
908 | 908 | |
909 | | - # FIXME: paste contents from Article::insertNewArticle here and |
910 | | - # actually handle errors it may return |
911 | | - $this->mArticle->insertNewArticle( $this->textbox1, $this->summary, |
912 | | - $this->minoredit, $this->watchthis, false, $isComment, $bot ); |
| 909 | + $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | |
| 910 | + ( $this->minoredit ? EDIT_MINOR : 0 ) | |
| 911 | + ( $bot ? EDIT_FORCE_BOT : 0 ); |
| 912 | + $this->mArticle->doEdit( $this->textbox1, $this->summary, $flags, |
| 913 | + false, null, $this->watchthis, $isComment, '', true ); |
913 | 914 | |
914 | 915 | wfProfileOut( __METHOD__ ); |
915 | 916 | return self::AS_SUCCESS_NEW_ARTICLE; |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2345,10 +2345,6 @@ |
2346 | 2346 | * This clears some fields in this object, and clears any associated |
2347 | 2347 | * keys in the "bad links" section of the link cache. |
2348 | 2348 | * |
2349 | | - * - This is called from Article::insertNewArticle() to allow |
2350 | | - * loading of the new page_id. It's also called from |
2351 | | - * Article::doDeleteArticle() |
2352 | | - * |
2353 | 2349 | * @param $newid \type{\int} the new Article ID |
2354 | 2350 | */ |
2355 | 2351 | public function resetArticleID( $newid ) { |