From e6f93fc84140931d13c8e77b12fd6ec53a04457a Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 29 Jan 2014 10:43:13 +0100 Subject: 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. --- apps/files/lib/app.php | 7 +++++-- 1 file 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; -- cgit v1.2.3