Partially reverted r108111: we can't assume subclasses put thumbnails in the...thumbn...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 5 Jan 2012 23:35:38 +0000 (23:35 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 5 Jan 2012 23:35:38 +0000 (23:35 +0000)
includes/filerepo/file/File.php

index 5476366..11b812b 100644 (file)
@@ -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 {