Skip to content

Commit

Permalink
Make sure we only fetch the file by id for the actual owner
Browse files Browse the repository at this point in the history
Otherwise this will fetch all mounts for the file id which is quite
expensive and causes long saving times in big sharing structures

Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 1, 2019
1 parent 3f8f0f7 commit e26187c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static function store($filename) {
$eventDispatcher = \OC::$server->getEventDispatcher();
$fileInfo = $files_view->getFileInfo($filename);
$id = $fileInfo->getId();
$nodes = \OC::$server->getRootFolder()->getById($id);
$nodes = \OC::$server->getRootFolder()->getUserFolder($uid)->getById($id);
foreach ($nodes as $node) {
$event = new CreateVersionEvent($node);
$eventDispatcher->dispatch('OCA\Files_Versions::createVersion', $event);
Expand Down

0 comments on commit e26187c

Please sign in to comment.