From: Platonides Date: Tue, 21 Jun 2011 15:13:03 +0000 (+0000) Subject: Follow up with the problem noted in r90530. X-Git-Tag: 1.31.0-rc.0~29376 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=fd4b5f305f57f1726a512cb5ced0997cdb0cd7d5;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index f926584d96..8432f0d4f3 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -140,9 +140,11 @@ class UploadStash { // 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 // redesigning API errors significantly. // $status->value just contains the virtual URL (if anything) which is probably useless to the caller - $error = reset( $status->getErrorsArray() ); + $error = $status->getErrorsArray(); + $error = reset( $error ); if ( ! count( $error ) ) { - $error = reset( $status->getWarningsArray() ); + $error = $status->getWarningsArray(); + $error = reset( $error ); if ( ! count( $error ) ) { $error = array( 'unknown', 'no error recorded' ); }