https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113319

Revision: 113319
Author:   aaron
Date:     2012-03-07 23:04:21 +0000 (Wed, 07 Mar 2012)
Log Message:
-----------
MFT r113312

Modified Paths:
--------------
    branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php

Property Changed:
----------------
    branches/wmf/1.19wmf1/
    branches/wmf/1.19wmf1/includes/


Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting:100352-107913
/branches/REL1_15/phase3:51646
/branches/REL1_17/phase3:81445,81448
/branches/new-installer/phase3:43664-66004
/branches/sqlite:58211-58321
/branches/wmf/1.18wmf1:97508,111667
/trunk/phase3:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111795,111802-111803,111827,111881,111920,111965-111967,112021,112034,112037,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112100,112128,112132-112133,112141,112152,112169-112170,112172-112173,112179,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112533-112534,112563,112566,112573,112700,112750,112839-112840,112843,112855,112866,112951,112995,113039,113085,113099,113169
   + /branches/JSTesting:100352-107913
/branches/REL1_15/phase3:51646
/branches/REL1_17/phase3:81445,81448
/branches/new-installer/phase3:43664-66004
/branches/sqlite:58211-58321
/branches/wmf/1.18wmf1:97508,111667
/trunk/phase3:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111795,111802-111803,111827,111881,111920,111965-111967,112021,112034,112037,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112100,112128,112132-112133,112141,112152,112169-112170,112172-112173,112179,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112533-112534,112563,112566,112573,112700,112750,112839-112840,112843,112855,112866,112951,112995,113039,113085,113099,113169,113312


Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/JSTesting/includes:100352-107913
/branches/REL1_15/phase3/includes:51646
/branches/new-installer/phase3/includes:43664-66004
/branches/sqlite/includes:58211-58321
/branches/wmf/1.18wmf1/includes:97508,111667
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:111029,111034,111067,111085,111128,111144,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111827,111965-111967,112021,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112128,112132-112133,112152,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112534,112563,112700,112839-112840,112843,112855,112866,112951,112995,113099,113169
   + /branches/JSTesting/includes:100352-107913
/branches/REL1_15/phase3/includes:51646
/branches/new-installer/phase3/includes:43664-66004
/branches/sqlite/includes:58211-58321
/branches/wmf/1.18wmf1/includes:97508,111667
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:111029,111034,111067,111085,111128,111144,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111827,111965-111967,112021,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112128,112132-112133,112152,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112534,112563,112700,112839-112840,112843,112855,112866,112951,112995,113099,113169,113312

Modified: branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php
===================================================================
--- branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php  2012-03-07 
23:03:48 UTC (rev 113318)
+++ branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php  2012-03-07 
23:04:21 UTC (rev 113319)
@@ -907,7 +907,10 @@
                $this->lock(); // begin
                $status = $this->publish( $srcPath, $flags );
 
-               if ( $status->ok ) {
+               if ( $status->successCount > 0 ) {
+                       # Essentially we are displacing any existing current 
file and saving
+                       # a new current file at the old location. If just the 
first succeeded,
+                       # we still need to displace the current DB entry and 
put in a new one.
                        if ( !$this->recordUpload2( $status->value, $comment, 
$pageText, $props, $timestamp, $user ) ) {
                                $status->fatal( 'filenotfound', $srcPath );
                        }
@@ -1004,8 +1007,12 @@
                );
 
                if ( $dbw->affectedRows() == 0 ) {
-                       if ( $oldver == '' ) {
-                               throw new MWException( "Empty oi_archive_name. 
Database and storage out of sync?" );
+                       if ( $oldver == '' ) { // XXX
+                               # (bug 34993) publish() can displace the 
current file and yet fail to save 
+                               # a new one. The next publish attempt will 
treat the file as a brand new file 
+                               # and pass an empty $oldver. Allow this bogus 
value so we can displace the 
+                               # `image` row to `oldimage`, leaving room for 
the new current file `image` row.
+                               #throw new MWException( "Empty oi_archive_name. 
Database and storage out of sync?" );
                        }
                        $reupload = true;
                        # Collision, this is an update of a file


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to