Index: branches/wmf/1.19wmf1/includes/filerepo/file/LocalFile.php |
— | — | @@ -907,7 +907,10 @@ |
908 | 908 | $this->lock(); // begin |
909 | 909 | $status = $this->publish( $srcPath, $flags ); |
910 | 910 | |
911 | | - if ( $status->ok ) { |
| 911 | + if ( $status->successCount > 0 ) { |
| 912 | + # Essentially we are displacing any existing current file and saving |
| 913 | + # a new current file at the old location. If just the first succeeded, |
| 914 | + # we still need to displace the current DB entry and put in a new one. |
912 | 915 | if ( !$this->recordUpload2( $status->value, $comment, $pageText, $props, $timestamp, $user ) ) { |
913 | 916 | $status->fatal( 'filenotfound', $srcPath ); |
914 | 917 | } |
— | — | @@ -1004,8 +1007,12 @@ |
1005 | 1008 | ); |
1006 | 1009 | |
1007 | 1010 | if ( $dbw->affectedRows() == 0 ) { |
1008 | | - if ( $oldver == '' ) { |
1009 | | - throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" ); |
| 1011 | + if ( $oldver == '' ) { // XXX |
| 1012 | + # (bug 34993) publish() can displace the current file and yet fail to save |
| 1013 | + # a new one. The next publish attempt will treat the file as a brand new file |
| 1014 | + # and pass an empty $oldver. Allow this bogus value so we can displace the |
| 1015 | + # `image` row to `oldimage`, leaving room for the new current file `image` row. |
| 1016 | + #throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" ); |
1010 | 1017 | } |
1011 | 1018 | $reupload = true; |
1012 | 1019 | # Collision, this is an update of a file |
Property changes on: branches/wmf/1.19wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1013 | 1020 | Merged /trunk/phase3/includes:r113312 |
Property changes on: branches/wmf/1.19wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1014 | 1021 | Merged /trunk/phase3:r113312 |