http://www.mediawiki.org/wiki/Special:Code/MediaWiki/68606
Revision: 68606 Author: mgrabovsky Date: 2010-06-26 13:25:08 +0000 (Sat, 26 Jun 2010) Log Message: ----------- (bug 18891) Deprecated Article::insertNewArticle still used in core Modified Paths: -------------- trunk/phase3/docs/hooks.txt trunk/phase3/includes/Article.php trunk/phase3/includes/EditPage.php trunk/phase3/includes/Title.php trunk/phase3/maintenance/addwiki.php trunk/phase3/maintenance/parserTests.inc Modified: trunk/phase3/docs/hooks.txt =================================================================== --- trunk/phase3/docs/hooks.txt 2010-06-26 12:50:50 UTC (rev 68605) +++ trunk/phase3/docs/hooks.txt 2010-06-26 13:25:08 UTC (rev 68606) @@ -653,7 +653,7 @@ $editPage: EditPage object 'EditPage::attemptSave': called before an article is -saved, that is before insertNewArticle() is called +saved, that is before Article::doEdit() is called $editpage_Obj: the current EditPage object 'EditPage::importFormData': allow extensions to read additional data Modified: trunk/phase3/includes/Article.php =================================================================== --- trunk/phase3/includes/Article.php 2010-06-26 12:50:50 UTC (rev 68605) +++ trunk/phase3/includes/Article.php 2010-06-26 13:25:08 UTC (rev 68606) @@ -1965,6 +1965,7 @@ * it. Nevertheless, use Article::doEdit() instead. */ function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC = false, $comment = false, $bot = false ) { + wfDeprecated( __METHOD__ ); $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | ( $isminor ? EDIT_MINOR : 0 ) | ( $suppressRC ? EDIT_SUPPRESS_RC : 0 ) | Modified: trunk/phase3/includes/EditPage.php =================================================================== --- trunk/phase3/includes/EditPage.php 2010-06-26 12:50:50 UTC (rev 68605) +++ trunk/phase3/includes/EditPage.php 2010-06-26 13:25:08 UTC (rev 68606) @@ -905,10 +905,11 @@ $isComment = ( $this->section == 'new' ); - # FIXME: paste contents from Article::insertNewArticle here and - # actually handle errors it may return - $this->mArticle->insertNewArticle( $this->textbox1, $this->summary, - $this->minoredit, $this->watchthis, false, $isComment, $bot ); + $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | + ( $this->minoredit ? EDIT_MINOR : 0 ) | + ( $bot ? EDIT_FORCE_BOT : 0 ); + $this->mArticle->doEdit( $this->textbox1, $this->summary, $flags, + false, null, $this->watchthis, $isComment, '', true ); wfProfileOut( __METHOD__ ); return self::AS_SUCCESS_NEW_ARTICLE; Modified: trunk/phase3/includes/Title.php =================================================================== --- trunk/phase3/includes/Title.php 2010-06-26 12:50:50 UTC (rev 68605) +++ trunk/phase3/includes/Title.php 2010-06-26 13:25:08 UTC (rev 68606) @@ -2345,10 +2345,6 @@ * This clears some fields in this object, and clears any associated * keys in the "bad links" section of the link cache. * - * - This is called from Article::insertNewArticle() to allow - * loading of the new page_id. It's also called from - * Article::doDeleteArticle() - * * @param $newid \type{\int} the new Article ID */ public function resetArticleID( $newid ) { Modified: trunk/phase3/maintenance/addwiki.php =================================================================== --- trunk/phase3/maintenance/addwiki.php 2010-06-26 12:50:50 UTC (rev 68605) +++ trunk/phase3/maintenance/addwiki.php 2010-06-26 13:25:08 UTC (rev 68606) @@ -130,7 +130,8 @@ $wgArticle = new Article( $wgTitle ); $ucsite = ucfirst( $site ); - $wgArticle->insertNewArticle( $this->getFirstArticle( $ucsite, $name ), '', false, false ); + $wgArticle->doEdit( $this->getFirstArticle( $ucsite, $name ), '', EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, + false, null, false, false, '', true ); $this->output( "Adding to dblists\n" ); Modified: trunk/phase3/maintenance/parserTests.inc =================================================================== --- trunk/phase3/maintenance/parserTests.inc 2010-06-26 12:50:50 UTC (rev 68605) +++ trunk/phase3/maintenance/parserTests.inc 2010-06-26 13:25:08 UTC (rev 68606) @@ -1040,7 +1040,8 @@ } $art = new Article( $title ); - $art->insertNewArticle( $text, '', false, false ); + $art->doEdit( $text, '', EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY, + false, null, false, false, '', true ); $this->teardownGlobals(); } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs