r68609 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68608‎ | r68609 | r68610 >
Date:19:52, 26 June 2010
Author:mgrabovsky
Status:reverted
Tags:
Comment:
Follow-up r68606, per comments:
* Made proper use of Article::doEdit's return value (hopefully)
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1961,8 +1961,7 @@
19621962 }
19631963
19641964 /**
1965 - * This function is not deprecated until somebody fixes the core not to use
1966 - * it. Nevertheless, use Article::doEdit() instead.
 1965+ * @deprecated use Article::doEdit()
19671966 */
19681967 function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC = false, $comment = false, $bot = false ) {
19691968 wfDeprecated( __METHOD__ );
Index: trunk/phase3/includes/EditPage.php
@@ -908,11 +908,17 @@
909909 $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
910910 ( $this->minoredit ? EDIT_MINOR : 0 ) |
911911 ( $bot ? EDIT_FORCE_BOT : 0 );
912 - $this->mArticle->doEdit( $this->textbox1, $this->summary, $flags,
 912+ $status = $this->mArticle->doEdit( $this->textbox1, $this->summary, $flags,
913913 false, null, $this->watchthis, $isComment, '', true );
914914
 915+ if ( $status->isOK() ) {
 916+ wfProfileOut( __METHOD__ );
 917+ return self::AS_SUCCESS_NEW_ARTICLE;
 918+ } else {
 919+ $result = $status->getErrorsArray();
 920+ }
915921 wfProfileOut( __METHOD__ );
916 - return self::AS_SUCCESS_NEW_ARTICLE;
 922+ return self::AS_END;
917923 }
918924
919925 # Article exists. Check for edit conflict.

Follow-up revisions

RevisionCommit summaryAuthorDate
r70760* Revert r66878, completely misses the point of factoring out doEdit() in the...tstarling08:33, 9 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68606(bug 18891) Deprecated Article::insertNewArticle still used in coremgrabovsky13:25, 26 June 2010

Status & tagging log