From: Aaron Schulz Date: Thu, 5 Jan 2012 23:35:38 +0000 (+0000) Subject: Partially reverted r108111: we can't assume subclasses put thumbnails in the...thumbn... X-Git-Tag: 1.31.0-rc.0~25495 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=e4acd105f9271ac569e5cd6e2d0e1c4f5eae00d8;p=lhc%2Fweb%2Fwiklou.git Partially reverted r108111: we can't assume subclasses put thumbnails in the...thumbnails zone. They might override the thumbnail path functions. --- 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 {