{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/22444","repository_url":"https://api.github.com/repos/owncloud/core","labels_url":"https://api.github.com/repos/owncloud/core/issues/22444/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/22444/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/22444/events","html_url":"https://github.com/owncloud/core/pull/22444","id":134026887,"number":22444,"title":"get the actual user instead of a federated cloud id","user":{"login":"schiesbn","id":1589737,"avatar_url":"https://avatars.githubusercontent.com/u/1589737?v=3","gravatar_id":"","url":"https://api.github.com/users/schiesbn","html_url":"https://github.com/schiesbn","followers_url":"https://api.github.com/users/schiesbn/followers","following_url":"https://api.github.com/users/schiesbn/following{/other_user}","gists_url":"https://api.github.com/users/schiesbn/gists{/gist_id}","starred_url":"https://api.github.com/users/schiesbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schiesbn/subscriptions","organizations_url":"https://api.github.com/users/schiesbn/orgs","repos_url":"https://api.github.com/users/schiesbn/repos","events_url":"https://api.github.com/users/schiesbn/events{/privacy}","received_events_url":"https://api.github.com/users/schiesbn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/3%20-%20To%20Review","name":"3 - To Review","color":"ededed"},{"url":"https://api.github.com/repos/owncloud/core/labels/app:files_trashbin","name":"app:files_trashbin","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/app:files_versions","name":"app:files_versions","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/owncloud/core/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/owncloud/core/labels/regression","name":"regression","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/48","html_url":"https://github.com/owncloud/core/milestones/9.0-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/48/labels","id":1196845,"number":48,"title":"9.0-current","description":"","creator":{"login":"cmonteroluque","id":879976,"avatar_url":"https://avatars.githubusercontent.com/u/879976?v=3","gravatar_id":"","url":"https://api.github.com/users/cmonteroluque","html_url":"https://github.com/cmonteroluque","followers_url":"https://api.github.com/users/cmonteroluque/followers","following_url":"https://api.github.com/users/cmonteroluque/following{/other_user}","gists_url":"https://api.github.com/users/cmonteroluque/gists{/gist_id}","starred_url":"https://api.github.com/users/cmonteroluque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmonteroluque/subscriptions","organizations_url":"https://api.github.com/users/cmonteroluque/orgs","repos_url":"https://api.github.com/users/cmonteroluque/repos","events_url":"https://api.github.com/users/cmonteroluque/events{/privacy}","received_events_url":"https://api.github.com/users/cmonteroluque/received_events","type":"User","site_admin":false},"open_issues":502,"closed_issues":1558,"state":"open","created_at":"2015-07-07T14:21:23Z","updated_at":"2016-02-18T09:14:32Z","due_on":"2016-03-08T04:00:00Z","closed_at":null},"comments":6,"created_at":"2016-02-16T16:28:03Z","updated_at":"2016-02-18T09:19:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/22444","html_url":"https://github.com/owncloud/core/pull/22444","diff_url":"https://github.com/owncloud/core/pull/22444.diff","patch_url":"https://github.com/owncloud/core/pull/22444.patch"},"body":"`$view->getUidAndFilename($filename);` returns the federated cloud id in case of a federated share. But in the case of versioning and trashbin we need the local user who \"owns\" the file which is the current logged in user in case of a federated share.\r\n\r\nThis reverts changes introduced here by @icewind1991: https://github.com/owncloud/core/commit/300eb54c871cfe48165ee32ecdc5067226aa0b7b \r\n\r\nWhile in most cases in makes sense to return the federated cloud id of the owner of the file. In this cases it breaks the trashbin and versions.\r\n\r\nSteps to test:\r\n\r\n- set up two ownClouds\r\n- ownCloud1 shares a folder which contains a file to ownCloud2\r\n- try to delete the file on ownCloud2\r\n\r\nExpected: \r\n\r\nFile gets deleted and added to the trashbin of owner@ownCloud1 and to the user at ownCloud2\r\n\r\nActual Result: \r\n\r\ndelete fails with this exception:\r\n\r\n````\r\n{\"reqId\":\"h3FJVmACIo8+mISwiP+g\",\"remoteAddr\":\"::1\",\"app\":\"files\",\"message\":\" Backends provided no user object for schiesbn@localhost\\/federation\\/\",\"level\":3,\"time\":\"2016-02-16T16:08:39+00:00\"}\r\n{\"reqId\":\"h3FJVmACIo8+mISwiP+g\",\"remoteAddr\":\"::1\",\"app\":\"no app in context\",\"message\":\"Exception: {\\\"Exception\\\":\\\"OC\\\\\\\\User\\\\\\\\NoUserException\\\",\\\"Message\\\":\\\"Backends provided no user object for schiesbn@localhost\\\\\\/federation\\\\\\/\\\",\\\"Code\\\":0,\\\"Trace\\\":\\\"#0 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/files_trashbin\\\\\\/lib\\\\\\/trashbin.php(80): OC\\\\\\\\Files\\\\\\\\Filesystem::initMountPoints('schiesbn@localh...')\\\\n#1 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/files_trashbin\\\\\\/lib\\\\\\/trashbin.php(67): OCA\\\\\\\\Files_Trashbin\\\\\\\\Trashbin::getUidAndFilename('\\\\\\/New folder\\\\\\/wel...')\\\\n#2 [internal function]: OCA\\\\\\\\Files_Trashbin\\\\\\\\Trashbin::ensureFileScannedHook(Array)\\\\n#3 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/hook.php(104): call_user_func(Array, Array)\\\\n#4 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php(1172): OC_Hook::emit('OC_Filesystem', 'delete', Array)\\\\n#5 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php(1048): OC\\\\\\\\Files\\\\\\\\View->runHooks(Array, '\\\\\\/New folder\\\\\\/wel...')\\\\n#6 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php(641): OC\\\\\\\\Files\\\\\\\\View->basicOperation('unlink', '\\\\\\/New folder\\\\\\/wel...', Array)\\\\n#7 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/dav\\\\\\/lib\\\\\\/connector\\\\\\/sabre\\\\\\/file.php(320): OC\\\\\\\\Files\\\\\\\\View->unlink('\\\\\\/New folder\\\\\\/wel...')\\\\n#8 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Tree.php(179): OCA\\\\\\\\DAV\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\File->delete()\\\\n#9 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/CorePlugin.php(287): Sabre\\\\\\\\DAV\\\\\\\\Tree->delete('New folder\\\\\\/welc...')\\\\n#10 [internal function]: Sabre\\\\\\\\DAV\\\\\\\\CorePlugin->httpDelete(Object(Sabre\\\\\\\\HTTP\\\\\\\\Request), Object(Sabre\\\\\\\\HTTP\\\\\\\\Response))\\\\n#11 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/event\\\\\\/lib\\\\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\\\n#12 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(459): Sabre\\\\\\\\Event\\\\\\\\EventEmitter->emit('method:DELETE', Array)\\\\n#13 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(248): Sabre\\\\\\\\DAV\\\\\\\\Server->invokeMethod(Object(Sabre\\\\\\\\HTTP\\\\\\\\Request), Object(Sabre\\\\\\\\HTTP\\\\\\\\Response))\\\\n#14 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/dav\\\\\\/appinfo\\\\\\/v1\\\\\\/webdav.php(54): Sabre\\\\\\\\DAV\\\\\\\\Server->exec()\\\\n#15 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/remote.php(137): require_once('\\\\\\/home\\\\\\/src\\\\\\/owncl...')\\\\n#16 {main}\\\",\\\"File\\\":\\\"\\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/filesystem.php\\\",\\\"Line\\\":387}\",\"level\":3,\"time\":\"2016-02-16T16:08:39+00:00\"}\r\n{\"reqId\":\"h3FJVmACIo8+mISwiP+g\",\"remoteAddr\":\"::1\",\"app\":\"no app in context\",\"message\":\"Exception: {\\\"Exception\\\":\\\"OCP\\\\\\\\Files\\\\\\\\NotFoundException\\\",\\\"Message\\\":\\\"File with id \\\\\\\"11\\\\\\\" has not been found.\\\",\\\"Code\\\":0,\\\"Trace\\\":\\\"#0 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/files_versions\\\\\\/lib\\\\\\/storage.php(98): OC\\\\\\\\Files\\\\\\\\View->getPath(11)\\\\n#1 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/files_versions\\\\\\/lib\\\\\\/storage.php(198): OCA\\\\\\\\Files_Versions\\\\\\\\Storage::getUidAndFilename('\\\\\\/New folder\\\\\\/wel...')\\\\n#2 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/files_versions\\\\\\/lib\\\\\\/hooks.php(90): OCA\\\\\\\\Files_Versions\\\\\\\\Storage::markDeletedFile('\\\\\\/New folder\\\\\\/wel...')\\\\n#3 [internal function]: OCA\\\\\\\\Files_Versions\\\\\\\\Hooks::pre_remove_hook(Array)\\\\n#4 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/hook.php(104): call_user_func(Array, Array)\\\\n#5 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php(1172): OC_Hook::emit('OC_Filesystem', 'delete', Array)\\\\n#6 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php(1048): OC\\\\\\\\Files\\\\\\\\View->runHooks(Array, '\\\\\\/New folder\\\\\\/wel...')\\\\n#7 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php(641): OC\\\\\\\\Files\\\\\\\\View->basicOperation('unlink', '\\\\\\/New folder\\\\\\/wel...', Array)\\\\n#8 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/dav\\\\\\/lib\\\\\\/connector\\\\\\/sabre\\\\\\/file.php(320): OC\\\\\\\\Files\\\\\\\\View->unlink('\\\\\\/New folder\\\\\\/wel...')\\\\n#9 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Tree.php(179): OCA\\\\\\\\DAV\\\\\\\\Connector\\\\\\\\Sabre\\\\\\\\File->delete()\\\\n#10 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/CorePlugin.php(287): Sabre\\\\\\\\DAV\\\\\\\\Tree->delete('New folder\\\\\\/welc...')\\\\n#11 [internal function]: Sabre\\\\\\\\DAV\\\\\\\\CorePlugin->httpDelete(Object(Sabre\\\\\\\\HTTP\\\\\\\\Request), Object(Sabre\\\\\\\\HTTP\\\\\\\\Response))\\\\n#12 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/event\\\\\\/lib\\\\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\\\n#13 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(459): Sabre\\\\\\\\Event\\\\\\\\EventEmitter->emit('method:DELETE', Array)\\\\n#14 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/3rdparty\\\\\\/sabre\\\\\\/dav\\\\\\/lib\\\\\\/DAV\\\\\\/Server.php(248): Sabre\\\\\\\\DAV\\\\\\\\Server->invokeMethod(Object(Sabre\\\\\\\\HTTP\\\\\\\\Request), Object(Sabre\\\\\\\\HTTP\\\\\\\\Response))\\\\n#15 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/apps\\\\\\/dav\\\\\\/appinfo\\\\\\/v1\\\\\\/webdav.php(54): Sabre\\\\\\\\DAV\\\\\\\\Server->exec()\\\\n#16 \\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/remote.php(137): require_once('\\\\\\/home\\\\\\/src\\\\\\/owncl...')\\\\n#17 {main}\\\",\\\"File\\\":\\\"\\\\\\/home\\\\\\/src\\\\\\/owncloud\\\\\\/server\\\\\\/master\\\\\\/lib\\\\\\/private\\\\\\/files\\\\\\/view.php\\\",\\\"Line\\\":1639}\",\"level\":3,\"time\":\"2016-02-16T16:08:42+00:00\"}\r\n{\"reqId\":\"h3FJVmACIo8+mISwiP+g\",\"remoteAddr\":\"::1\",\"app\":\"PHP\",\"message\":\"Undefined index: \\/New folder\\/welcome.txt at \\/home\\/src\\/owncloud\\/server\\/master\\/apps\\/files_versions\\/lib\\/storage.php#226\",\"level\":3,\"time\":\"2016-02-16T16:08:45+00:00\"}\r\n````\r\n\r\n@icewind1991 @PVince81 please have a look. I think that's the smallest possible change to fix it for 9.0. Not sure if we can do something else for 9.1 in order to use `$view->getUidAndFilename($filename);` again.\r\n\r\n@rullzer I didn't revert the changes for apps/files_sharing/lib/helper.php yet: https://github.com/owncloud/core/commit/300eb54c871cfe48165ee32ecdc5067226aa0b7b#diff-407e98495650a16757767c1f2b423ddbR209\r\nDo you think we should revert this too? Is it still used for sharing 2.0 and do you think it can create problems if the federated cloud ID is returned here instead of a local user?"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/185618035","html_url":"https://github.com/owncloud/core/pull/22444#issuecomment-185618035","issue_url":"https://api.github.com/repos/owncloud/core/issues/22444","id":185618035,"user":{"login":"schiesbn","id":1589737,"avatar_url":"https://avatars.githubusercontent.com/u/1589737?v=3","gravatar_id":"","url":"https://api.github.com/users/schiesbn","html_url":"https://github.com/schiesbn","followers_url":"https://api.github.com/users/schiesbn/followers","following_url":"https://api.github.com/users/schiesbn/following{/other_user}","gists_url":"https://api.github.com/users/schiesbn/gists{/gist_id}","starred_url":"https://api.github.com/users/schiesbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schiesbn/subscriptions","organizations_url":"https://api.github.com/users/schiesbn/orgs","repos_url":"https://api.github.com/users/schiesbn/repos","events_url":"https://api.github.com/users/schiesbn/events{/privacy}","received_events_url":"https://api.github.com/users/schiesbn/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T09:19:29Z","updated_at":"2016-02-18T09:19:29Z","body":"reverted back to the old approach. This works and is the minimal solution for 9.0 without any side-effects."}}