r90531 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90530‎ | r90531 | r90532 >
Date:15:13, 21 June 2011
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Follow up with the problem noted in r90530.
You can't pass the result of a function to reset(), since it expects a reference.

Those random errors show now as UploadStashFileException: error storing file in
'tests/phpunit/includes/upload/bug29408.': fileexistserror images/temp/0/02/20110621151405!bug29408.
because it gets run twice in the same second.
Modified paths:
  • /trunk/phase3/includes/upload/UploadStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadStash.php
@@ -140,9 +140,11 @@
141141 // This is a bit lame, as we may have more info in the $status and we're throwing it away, but to fix it means
142142 // redesigning API errors significantly.
143143 // $status->value just contains the virtual URL (if anything) which is probably useless to the caller
144 - $error = reset( $status->getErrorsArray() );
 144+ $error = $status->getErrorsArray();
 145+ $error = reset( $error );
145146 if ( ! count( $error ) ) {
146 - $error = reset( $status->getWarningsArray() );
 147+ $error = $status->getWarningsArray();
 148+ $error = reset( $error );
147149 if ( ! count( $error ) ) {
148150 $error = array( 'unknown', 'no error recorded' );
149151 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90340(bug 29408) Key 'something.' is not in a proper format...btongminh14:56, 18 June 2011
r90341MFT non test part of r90340...btongminh15:06, 18 June 2011
r90530Revert r90483, if tesla has problems, it should get proper permissions to the...platonides15:06, 21 June 2011

Comments

#Comment by Siebrand (talk | contribs)   22:22, 11 July 2011

Tag 1.18 because r90340 is tagged 1.18.

Status & tagging log