}
/**
- * This function is not deprecated until somebody fixes the core not to use
- * it. Nevertheless, use Article::doEdit() instead.
+ * @deprecated use Article::doEdit()
*/
function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC = false, $comment = false, $bot = false ) {
wfDeprecated( __METHOD__ );
$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,
+ $status = $this->mArticle->doEdit( $this->textbox1, $this->summary, $flags,
false, null, $this->watchthis, $isComment, '', true );
+ if ( $status->isOK() ) {
+ wfProfileOut( __METHOD__ );
+ return self::AS_SUCCESS_NEW_ARTICLE;
+ } else {
+ $result = $status->getErrorsArray();
+ }
wfProfileOut( __METHOD__ );
- return self::AS_SUCCESS_NEW_ARTICLE;
+ return self::AS_END;
}
# Article exists. Check for edit conflict.