r113315 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113314‎ | r113315 | r113316 >
Date:23:00, 7 March 2012
Author:tstarling
Status:ok
Tags:
Comment:
Fix for r113312: explain the bug without the use of commented-out code
Modified paths:
  • /trunk/phase3/includes/filerepo/file/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/file/LocalFile.php
@@ -1017,13 +1017,11 @@
10181018 );
10191019
10201020 if ( $dbw->affectedRows() == 0 ) {
1021 - if ( $oldver == '' ) { // XXX
1022 - # (bug 34993) publish() can displace the current file and yet fail to save
1023 - # a new one. The next publish attempt will treat the file as a brand new file
1024 - # and pass an empty $oldver. Allow this bogus value so we can displace the
1025 - # `image` row to `oldimage`, leaving room for the new current file `image` row.
1026 - #throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" );
1027 - }
 1021+ # (bug 34993) Note: $oldver can be empty here, if the previous
 1022+ # version of the file was broken. Allow registration of the new
 1023+ # version to continue anyway, because that's better than having
 1024+ # an image that's not fixable by user operations.
 1025+
10281026 $reupload = true;
10291027 # Collision, this is an update of a file
10301028 # Insert previous contents into oldimage

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113312[FileRepo]...aaron22:46, 7 March 2012

Status & tagging log