r41245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41244‎ | r41245 | r41246 >
Date:10:17, 25 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Updates for r41244, with backwards compatibility.
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/specials/MV_SpecialCRUDStream.php (modified) (history)
  • /trunk/extensions/SpecialForm/SpecialForm.body.php (modified) (history)
  • /trunk/extensions/Translate/SpecialMagic.php (modified) (history)
  • /trunk/extensions/Translate/scripts/fuzzy.php (modified) (history)
  • /trunk/extensions/Translate/scripts/poimport.php (modified) (history)
  • /trunk/extensions/Translate/scripts/sync-group.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpecialForm/SpecialForm.body.php
@@ -228,8 +228,8 @@
229229
230230 $article = new Article($nt[$i]);
231231
232 -
233 - if (!$article->doEdit($text, wfMsg('formsavesummary', $form->name), EDIT_NEW)) {
 232+ $status = $article->doEdit($text, wfMsg('formsavesummary', $form->name), EDIT_NEW);
 233+ if ( $status === false || ( is_object( $status ) && !$status->isOK() ) ) {
234234 $wgOut->showErrorPage('formsaveerror', 'formsaveerrortext', array($title));
235235 return; # Don't continue
236236 }
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialCRUDStream.php
@@ -200,8 +200,8 @@
201201 // insert page
202202 $streamTitle = Title::newFromText( $this->stream_name, MV_NS_STREAM );
203203 $wgArticle = new Article( $streamTitle );
204 - $success = $wgArticle->doEdit( $this->stream_desc, wfMsg( 'mv_summary_add_stream' ) );
205 - if ( $success ) {
 204+ $status = $wgArticle->doEdit( $this->stream_desc, wfMsg( 'mv_summary_add_stream' ) );
 205+ if ( $status === true || ( is_object( $status ) && $status->isOK() ) ) {
206206 // stream inserted succesfully report to output
207207 $streamLink = $sk->makeLinkObj( $streamTitle, $this->stream_name );
208208 $out = 'stream ' . htmlspecialchars( $streamLink ) . ' added';
Index: trunk/extensions/Translate/scripts/poimport.php
@@ -234,9 +234,9 @@
235235
236236 $wgArticle = new Article( $wgTitle );
237237
238 - $success = $wgArticle->doEdit( $text, 'Updating translation from gettext import' );
 238+ $status = $wgArticle->doEdit( $text, 'Updating translation from gettext import' );
239239
240 - if ( $success ) {
 240+ if ( $status === true || ( is_object( $status ) && $status->isOK() ) ) {
241241 STDOUT( "OK!", $title );
242242 } else {
243243 STDOUT( "Failed!", $title );
Index: trunk/extensions/Translate/scripts/sync-group.php
@@ -285,7 +285,8 @@
286286
287287 $article = new Article( $title );
288288 STDOUT( "Importing {$title->getPrefixedText()}: ", $title );
289 - $success = $article->doEdit( $translation, $comment, $flags );
 289+ $status = $article->doEdit( $translation, $comment, $flags );
 290+ $success = $status === true || ( is_object( $status ) && $status->isOK() );
290291 STDOUT( $success ? 'OK' : 'FAILED', $title );
291292
292293 $wgUser = $old;
@@ -293,4 +294,4 @@
294295
295296 }
296297
297 -STDOUT( wfTimestamp( TS_RFC2822 ) );
\ No newline at end of file
 298+STDOUT( wfTimestamp( TS_RFC2822 ) );
Index: trunk/extensions/Translate/scripts/fuzzy.php
@@ -156,9 +156,9 @@
157157
158158 $comment = $this->comment ? $this->comment : 'Marking as fuzzy';
159159
160 - $success = $wgArticle->doEdit( TRANSLATE_FUZZY . $text, $comment, EDIT_FORCE_BOT );
 160+ $status = $wgArticle->doEdit( TRANSLATE_FUZZY . $text, $comment, EDIT_FORCE_BOT );
161161
162 - if ( $success ) {
 162+ if ( $status === true || ( is_object( $status ) && $status->isOK() ) ) {
163163 STDOUT( "OK!", false );
164164 } else {
165165 STDOUT( "Failed!", false );
@@ -166,4 +166,4 @@
167167
168168 }
169169
170 -}
\ No newline at end of file
 170+}
Index: trunk/extensions/Translate/SpecialMagic.php
@@ -469,9 +469,9 @@
470470 $data = "# DO NOT EDIT THIS PAGE DIRECTLY! Use [[Special:Magic]].\n<pre>\n" . $this->formatForSave( $request ) . "\n</pre>";
471471
472472 $comment = $request->getText( 'comment', wfMsgForContent( self::MSG . 'updatedusing' ) );
473 - $success = $article->doEdit( $data, $comment, 0 );
 473+ $status = $article->doEdit( $data, $comment, 0 );
474474
475 - if ( !$success ) {
 475+ if ( $status === false || ( is_object( $status ) && !$status->isOK() ) ) {
476476 throw new MWException( wfMsgHtml( self::MSG . 'savefailed' ) );
477477 }
478478

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41244Re r41198: if you're going to break the interface, you may as well do it prop...tstarling10:15, 25 September 2008