From e4acd105f9271ac569e5cd6e2d0e1c4f5eae00d8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 5 Jan 2012 23:35:38 +0000 Subject: [PATCH] Partially reverted r108111: we can't assume subclasses put thumbnails in the...thumbnails zone. They might override the thumbnail path functions. --- includes/filerepo/file/File.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 5476366aaf..11b812ba7a 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -807,9 +807,12 @@ abstract class File { } } elseif ( $thumb->hasFile() && !$thumb->fileIsSource() ) { // Copy the thumbnail from the file system into storage - $status = $this->repo->store( - $tmpThumbPath, 'thumb', $this->getThumbRel( $thumbName ), - FileRepo::OVERWRITE | FileRepo::SKIP_LOCKING | FileRepo::ALLOW_STALE ); + // We don't use FileRepo::store() because of hacky suclasses + // overriding File::getThumbPath() to use a different zone (e.g. 'temp'). + $status = $this->repo->getBackend()->store( + array( 'src' => $tmpThumbPath, 'dst' => $thumbPath ), + array( 'ignoreErrors' => 1, 'nonLocking' => 1, 'allowStale' => 1 ) + ); if ( $status->isOK() ) { $thumb->setStoragePath( $thumbPath ); } else { -- 2.20.1