$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
* 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 ) |
$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;
* 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 ) {
$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" );
}
$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();
}