summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-01-29 10:43:13 +0100
committerVincent Petry <pvince81@owncloud.com>2014-01-29 10:43:13 +0100
commite6f93fc84140931d13c8e77b12fd6ec53a04457a (patch)
tree26ff98195ed1db986c3fc9837cdc1bcf1f9fa32c /apps/files/lib
parentcf2c061f1f2577b3a995d9e2423c93589d7df2b3 (diff)
downloadnextcloud-server-e6f93fc84140931d13c8e77b12fd6ec53a04457a.tar.gz
nextcloud-server-e6f93fc84140931d13c8e77b12fd6ec53a04457a.zip
Fix warnings in logs when renaming over the web UI
The determineIcon() method was expecting attributes to be set which caused warnings about undefined indices in the error log. This fix pre-initializes the array with 'directory' and 'isPreviewAvailable' to make them disappear.
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/app.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php
index e04ac173d55..1ac266073db 100644
--- a/apps/files/lib/app.php
+++ b/apps/files/lib/app.php
@@ -83,14 +83,17 @@ class App {
else {
$meta['type'] = 'file';
}
+ // these need to be set for determineIcon()
+ $meta['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']);
+ $meta['directory'] = $dir;
$fileinfo = array(
'id' => $meta['fileid'],
'mime' => $meta['mimetype'],
'size' => $meta['size'],
'etag' => $meta['etag'],
- 'directory' => $dir,
+ 'directory' => $meta['directory'],
'name' => $newname,
- 'isPreviewAvailable' => \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']),
+ 'isPreviewAvailable' => $meta['isPreviewAvailable'],
'icon' => \OCA\Files\Helper::determineIcon($meta)
);
$result['success'] = true;