{"action":"closed","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8396","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-framework","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8396/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8396/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/8396/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/8396","id":362815665,"node_id":"MDU6SXNzdWUzNjI4MTU2NjU=","number":8396,"title":"New Members receive the locale of the currently logged in user, instead of i18n::$default_locale","user":{"login":"jonom","id":1079425,"node_id":"MDQ6VXNlcjEwNzk0MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/1079425?v=4","gravatar_id":"","url":"https://api.github.com/users/jonom","html_url":"https://github.com/jonom","followers_url":"https://api.github.com/users/jonom/followers","following_url":"https://api.github.com/users/jonom/following{/other_user}","gists_url":"https://api.github.com/users/jonom/gists{/gist_id}","starred_url":"https://api.github.com/users/jonom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonom/subscriptions","organizations_url":"https://api.github.com/users/jonom/orgs","repos_url":"https://api.github.com/users/jonom/repos","events_url":"https://api.github.com/users/jonom/events{/privacy}","received_events_url":"https://api.github.com/users/jonom/received_events","type":"User","site_admin":false},"labels":[{"id":386316041,"node_id":"MDU6TGFiZWwzODYzMTYwNDE=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/affects/v4","name":"affects/v4","color":"5319e7","default":false},{"id":86042187,"node_id":"MDU6TGFiZWw4NjA0MjE4Nw==","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/change/patch","name":"change/patch","color":"fef2c0","default":false},{"id":34485697,"node_id":"MDU6TGFiZWwzNDQ4NTY5Nw==","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/effort/easy","name":"effort/easy","color":"c2e0c6","default":false},{"id":182941369,"node_id":"MDU6TGFiZWwxODI5NDEzNjk=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/impact/medium","name":"impact/medium","color":"f7c6c7","default":false},{"id":421035839,"node_id":"MDU6TGFiZWw0MjEwMzU4Mzk=","url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/type/bug","name":"type/bug","color":"d93f0b","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-22T01:34:08Z","updated_at":"2018-10-03T11:18:27Z","closed_at":"2018-10-03T11:18:27Z","author_association":"CONTRIBUTOR","body":"## Affected Version\r\n\r\nObserved in SS 4.2.1\r\n\r\n## Description\r\n\r\nWhen a new `Member` is created, the Locale property is populated from `i18n::get_locale()`. This method returns the current locale if set, and falls back to the `i18n::$default_locale` config property. \r\n\r\nWhen a user logs in to the CMS, the current locale is set according to that user's locale (in `LeftAndMain::init()`).\r\n\r\nThis leads to new users inheriting the locale of the currently logged in CMS user, instead of the `i18n::$default_locale` property.\r\n\r\nI don't think that the locale of the currently logged in member should influence the locale of new Members, especially if a developer has provided a default locale through yml config. The default locale should trump the locale of the current user.\r\n\r\n## Steps to Reproduce\r\n\r\n1. Note the locale of the currently logged in user (in Security section of CMS)\r\n2. Set the default locale to something else through yml config and flush\r\n```\r\nSilverStripe\\i18n\\i18n:\r\n  default_locale: 'en_GB'\r\n```\r\n3. Try to create a new Member in the CMS. The locale will be pre-selected to match the logged in user rather than the specified default.\r\n\r\n## Why is this a problem\r\n\r\n* I suspect CMS users don't pay a lot of attention to the locale field, so I think it's important that the default is respected as users may not correct a problem if present\r\n* The workflow of setting up a new site may lead to en_US being the de-facto default locale, despite configuration otherwise*\r\n\r\n*I discovered this issue because the New Member form always had en_US selected, even though I knew I'd set the default locale to en_GB. Once I dug in to how Members receive a locale I realised that my default administrator Member received an en_US locale during installation, before I changed the default locale through yml config. If I hadn't paid attention all new Members I created after that would have gotten the en_US locale too. (Note: Possibly the installer wizard asks you what locale to use for your default admin, but I use a parent .env file so skip this process.)"}}
{"actor":{"display_login":"robbieaverill"}}