Fixed annoying bug in FileRepo::deleteBatch() when a file is deleted that has multipl...
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 14 Jan 2012 00:50:18 +0000 (00:50 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 14 Jan 2012 00:50:18 +0000 (00:50 +0000)
includes/filerepo/FileRepo.php

index cd9b2bb..c770811 100644 (file)
@@ -1083,18 +1083,14 @@ class FileRepo {
                        }
                        $this->initDeletedDir( $archiveDir );
 
-                       if ( $backend->fileExists( array( 'src' => $archivePath ) ) ) {
-                               $operations[] = array(
-                                       'op'  => 'delete',
-                                       'src' => $srcPath
-                               );
-                       } else {
-                               $operations[] = array(
-                                       'op'  => 'move',
-                                       'src' => $srcPath,
-                                       'dst' => $archivePath
-                               );
-                       }
+                       $operations[] = array(
+                               'op'            => 'move',
+                               'src'           => $srcPath,
+                               'dst'           => $archivePath,
+                               // We may have 2+ identical files being deleted,
+                               // all of which will map to the same destination file
+                               'overwriteSame' => true
+                       );
                }
 
                // Move the files by execute the operations for each pair.