From: Tim Starling Date: Wed, 7 Mar 2012 23:00:42 +0000 (+0000) Subject: Fix for r113312: explain the bug without the use of commented-out code X-Git-Tag: 1.31.0-rc.0~24340 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=86ec766e19073f9e5c4dac035b37418c52c663f6;p=lhc%2Fweb%2Fwiklou.git Fix for r113312: explain the bug without the use of commented-out code --- diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 3e93e68d5d..f37e4cc825 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1017,13 +1017,11 @@ class LocalFile extends File { ); if ( $dbw->affectedRows() == 0 ) { - 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?" ); - } + # (bug 34993) Note: $oldver can be empty here, if the previous + # version of the file was broken. Allow registration of the new + # version to continue anyway, because that's better than having + # an image that's not fixable by user operations. + $reupload = true; # Collision, this is an update of a file # Insert previous contents into oldimage