Merge "[FileRepo] Added hook to let us copy thumbnails into additional places as...
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index 8c9f7ff..d32a0e3 100644 (file)
@@ -842,6 +842,13 @@ abstract class File {
                                }
                        }
 
+                       // If the backend is ready-only, don't keep generating thumbnails
+                       // only to return transformation errors, just return the error now.
+                       if ( $this->repo->getReadOnlyReason() !== false ) {
+                               $thumb = $this->transformErrorOutput( $thumbPath, $thumbUrl, $params, $flags );
+                               break;
+                       }
+
                        // Create a temp FS file with the same extension and the thumbnail
                        $thumbExt = FileBackend::extensionFromPath( $thumbPath );
                        $tmpFile = TempFSFile::factory( 'transform_', $thumbExt );