From: Matěj Grabovský Date: Sat, 26 Jun 2010 19:52:52 +0000 (+0000) Subject: Follow-up r68606, per comments: X-Git-Tag: 1.31.0-rc.0~36374 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=d1bec9cbf2bc0150e78a92db0dcf9619bd9c2d01;p=lhc%2Fweb%2Fwiklou.git Follow-up r68606, per comments: * Made proper use of Article::doEdit's return value (hopefully) --- diff --git a/includes/Article.php b/includes/Article.php index 02729dbb07..b1855ca375 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1961,8 +1961,7 @@ class Article { } /** - * 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__ ); diff --git a/includes/EditPage.php b/includes/EditPage.php index 985da119be..d619e1a8e9 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -908,11 +908,17 @@ class EditPage { $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.