Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Commit

Permalink
Merge pull request #610 from owncloud/fix-609
Browse files Browse the repository at this point in the history
Fixes broken documents view
  • Loading branch information
VicDeo committed Mar 1, 2016
2 parents 40de183 + 7e18ca2 commit bea795d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions controller/documentcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,14 @@ public function listAll(){
$fileIds = array();
$documents = array();
foreach ($found as $key=>$document) {
if (is_object($document)){
$documents[] = $document->getData();
$fileData = $document->getData();
if (is_object($fileData)){
$documents[$key]['fileid'] = $document->getId();
$documents[$key]['path'] = $document->getPath();
$documents[$key]['name'] = $document->getName();
$documents[$key]['etag'] = $document->getEtag();
} else {
$documents[$key] = $document;
$documents[$key] = $fileData;
}
$documents[$key]['icon'] = preg_replace('/\.png$/', '.svg', \OCP\Template::mimetype_icon($document['mimetype']));
$documents[$key]['hasPreview'] = \OC::$server->getPreviewManager()->isMimeSupported($document['mimetype']);
Expand Down

0 comments on commit bea795d

Please sign in to comment.