{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/16334","labels_url":"https://api.github.com/repos/owncloud/core/issues/16334/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16334/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/16334/events","html_url":"https://github.com/owncloud/core/issues/16334","id":76038760,"number":16334,"title":"Cannot overwrite file through s2s with versions enabled","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"labels":[{"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"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-13T16:12:28Z","updated_at":"2015-05-13T16:18:45Z","closed_at":null,"body":"### Steps to reproduce\r\n1. Setup two ownCloud instances OC A and OC B\r\n2. Login in OC A\r\n3. Share a folder \"test\" with link, allow editing\r\n4. Mount the folder \"test\" in OC B\r\n5. Upload a file \"test/test.txt\"\r\n6. Upload another version of the file as \"test/test.txt\", overwrite the existing one\r\n7. Go to OC A again\r\n8. Check if a version was created\r\n\r\n### Expected result\r\nFile is overwritten, a version is created.\r\n\r\n### Actual result\r\nFile is not overwritten, no version created.\r\nAnd this in the log of OC A:\r\n```\r\n{\"reqId\":\"1eS3XJoKrGck9jpGE4Kf\",\"remoteAddr\":\"127.0.0.1\",\"app\":\"PHP\",\"message\":\"Call to a member function getUID() on null at \\/srv\\/www\\/htdocs\\/owncloud\\/apps\\/files_versions\\/lib\\/storage.php#543\",\"level\":3,\"time\":\"2015-05-13T16:08:50+00:00\",\"method\":\"PUT\",\"url\":\"\\/owncloud\\/public.php\\/webdav\\/testx.txt\"}\r\n```\r\n\r\nThis is because we try to get the user from the session (classic issue) but as we're connecting to public webdav, there is no user.\r\n\r\nWe should use the file owner when doing version expiration, not the accessing user.\r\n\r\n### Versions\r\nDoes NOT occur on master because it is hidden by another bug that prevents versions creation.\r\nIt WILL appear on master after https://github.com/owncloud/core/pull/16292 is merged.\r\n\r\nNot sure yet whether this is a regression, need to test on stable8."},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/101733125","html_url":"https://github.com/owncloud/core/issues/16334#issuecomment-101733125","issue_url":"https://api.github.com/repos/owncloud/core/issues/16334","id":101733125,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T16:18:45Z","updated_at":"2015-05-13T16:18:45Z","body":"It works fine on stable8. On that branch it still uses the owner id for expiration.\r\n\r\n@icewind1991 when moving to scheduleExpire() it seems you switched it to use the logged in user instead of the owner.\r\n\r\nI'll fix it."}}