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>
$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);