{"action":"opened","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/16016","labels_url":"https://api.github.com/repos/owncloud/core/issues/16016/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/16016/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/16016/events","html_url":"https://github.com/owncloud/core/issues/16016","id":72698860,"number":16016,"title":"\\OC\\Files\\Config\\MountProviderCollection::registerProvider() should add mounts for user already set up","user":{"login":"dagan","id":1211420,"avatar_url":"https://avatars.githubusercontent.com/u/1211420?v=3","gravatar_id":"","url":"https://api.github.com/users/dagan","html_url":"https://github.com/dagan","followers_url":"https://api.github.com/users/dagan/followers","following_url":"https://api.github.com/users/dagan/following{/other_user}","gists_url":"https://api.github.com/users/dagan/gists{/gist_id}","starred_url":"https://api.github.com/users/dagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagan/subscriptions","organizations_url":"https://api.github.com/users/dagan/orgs","repos_url":"https://api.github.com/users/dagan/repos","events_url":"https://api.github.com/users/dagan/events{/privacy}","received_events_url":"https://api.github.com/users/dagan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-02T21:09:20Z","updated_at":"2015-05-02T21:09:20Z","closed_at":null,"body":"```php\r\n/**\r\n * Add a provider for mount points\r\n *\r\n * @param \\OCP\\Files\\Config\\IMountProvider $provider\r\n */\r\npublic function registerProvider(IMountProvider $provider) {\r\n\t$this->providers[] = $provider;\r\n}\r\n```\r\nhttps://github.com/owncloud/core/blob/stable8/lib/private/files/config/mountprovidercollection.php#L47-L54\r\n\r\nIf ```OC\\Files\\Config\\MountProviderCollection::registerProvider()``` is called after any user has already been set up via ```OC\\Files\\Filesystem::initMountPoints($user)```, that user/those users will never get the mount points that would have been returned by the provider. This is particularly problematic for the logged-in user, since any call to ```OC\\Util::setupFS()```, will load mounts for the logged in user.\r\n\r\nThis has the effect of preventing any instance of ```OCP\\Files\\Config\\IMountProvider``` from depending on ```OCP\\Files\\IRootFolder``` since retrieving the root folder results in a call to ```OC\\Util::setupFS()```.\r\n\r\nPerhaps an array field can be added to store each user passed to ```::getMountsForUser()``` and a call to ```::registerProvider()``` could iterate over each previously processed user, retrieving the user's mounts and adding them via ```OC\\Files\\Filesystem::getMountManager()->addMount()```?"}}