{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24602","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24602/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24602/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24602/events","html_url":"https://github.com/Automattic/wp-calypso/pull/24602","id":319305455,"number":24602,"title":"Site settings: fix section not loading","user":{"login":"frontdevde","id":1562646,"avatar_url":"https://avatars0.githubusercontent.com/u/1562646?v=4","gravatar_id":"","url":"https://api.github.com/users/frontdevde","html_url":"https://github.com/frontdevde","followers_url":"https://api.github.com/users/frontdevde/followers","following_url":"https://api.github.com/users/frontdevde/following{/other_user}","gists_url":"https://api.github.com/users/frontdevde/gists{/gist_id}","starred_url":"https://api.github.com/users/frontdevde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frontdevde/subscriptions","organizations_url":"https://api.github.com/users/frontdevde/orgs","repos_url":"https://api.github.com/users/frontdevde/repos","events_url":"https://api.github.com/users/frontdevde/events{/privacy}","received_events_url":"https://api.github.com/users/frontdevde/received_events","type":"User","site_admin":false},"labels":[{"id":285009981,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Site%20Settings","name":"Site Settings","color":"006b75","default":false},{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"frontdevde","id":1562646,"avatar_url":"https://avatars0.githubusercontent.com/u/1562646?v=4","gravatar_id":"","url":"https://api.github.com/users/frontdevde","html_url":"https://github.com/frontdevde","followers_url":"https://api.github.com/users/frontdevde/followers","following_url":"https://api.github.com/users/frontdevde/following{/other_user}","gists_url":"https://api.github.com/users/frontdevde/gists{/gist_id}","starred_url":"https://api.github.com/users/frontdevde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frontdevde/subscriptions","organizations_url":"https://api.github.com/users/frontdevde/orgs","repos_url":"https://api.github.com/users/frontdevde/repos","events_url":"https://api.github.com/users/frontdevde/events{/privacy}","received_events_url":"https://api.github.com/users/frontdevde/received_events","type":"User","site_admin":false},"assignees":[{"login":"frontdevde","id":1562646,"avatar_url":"https://avatars0.githubusercontent.com/u/1562646?v=4","gravatar_id":"","url":"https://api.github.com/users/frontdevde","html_url":"https://github.com/frontdevde","followers_url":"https://api.github.com/users/frontdevde/followers","following_url":"https://api.github.com/users/frontdevde/following{/other_user}","gists_url":"https://api.github.com/users/frontdevde/gists{/gist_id}","starred_url":"https://api.github.com/users/frontdevde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frontdevde/subscriptions","organizations_url":"https://api.github.com/users/frontdevde/orgs","repos_url":"https://api.github.com/users/frontdevde/repos","events_url":"https://api.github.com/users/frontdevde/events{/privacy}","received_events_url":"https://api.github.com/users/frontdevde/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-05-01T19:50:06Z","updated_at":"2018-05-01T19:50:08Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/24602","html_url":"https://github.com/Automattic/wp-calypso/pull/24602","diff_url":"https://github.com/Automattic/wp-calypso/pull/24602.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/24602.patch"},"body":"## This PR\r\n- fixes issue https://github.com/Automattic/wp-calypso/issues/24598\r\n\r\n#### The cause of the issue\r\n\r\nVisiting site settings on a Simple site with Serbian as the selected site language throws this error:\r\n\r\n```\r\nTypeError: langSlug.split is not a function\r\n    at getLanguageCodeLabels\r\n...\r\n```\r\n\r\nIt turns out that the recent addition of https://github.com/Automattic/wp-calypso/pull/24562 surfaced a longstanding error where the language value for Serbian didn't match between the backend and the value used in Calypso. The error so far had just failed fairly silently as the language picker just constantly displayed the loading state.\r\n\r\n#### The solution for the issue\r\n\r\nFirst we fix the language code used for Serbian to the one that's used on the server. Then we also safeguard by testing for a string value (lang id from Jetpack) just in case there are other mismatches for Simple sites.\r\n\r\n## How to test\r\n\r\n- Navigate to `/wp-admin/options-general.php` on a Simple site\r\n- Change the language to `Srpski (latinica)`\r\n- Navigate to `settings/general/{your site}` in Calypso\r\n- You should see the after state as shown below\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n<img width=\"1208\" alt=\"screen shot 2018-05-01 at 19 43 19\" src=\"https://user-images.githubusercontent.com/1562646/39490532-12bbb9a6-4d81-11e8-981a-5e2ed679de94.png\">\r\n\r\n### After\r\n\r\n<img width=\"1209\" alt=\"screen shot 2018-05-01 at 20 30 48\" src=\"https://user-images.githubusercontent.com/1562646/39490572-2dc5b0ee-4d81-11e8-9eb6-197df79dba48.png\">\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/385770415","html_url":"https://github.com/Automattic/wp-calypso/pull/24602#issuecomment-385770415","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/24602","id":385770415,"user":{"login":"matticbot","id":18333116,"avatar_url":"https://avatars2.githubusercontent.com/u/18333116?v=4","gravatar_id":"","url":"https://api.github.com/users/matticbot","html_url":"https://github.com/matticbot","followers_url":"https://api.github.com/users/matticbot/followers","following_url":"https://api.github.com/users/matticbot/following{/other_user}","gists_url":"https://api.github.com/users/matticbot/gists{/gist_id}","starred_url":"https://api.github.com/users/matticbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matticbot/subscriptions","organizations_url":"https://api.github.com/users/matticbot/orgs","repos_url":"https://api.github.com/users/matticbot/repos","events_url":"https://api.github.com/users/matticbot/events{/privacy}","received_events_url":"https://api.github.com/users/matticbot/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T19:50:08Z","updated_at":"2018-05-01T19:50:08Z","author_association":"NONE","body":"Test live: https://calypso.live/?branch=fix/site-settings-section-not-loading"}}
{"actor":{"display_login":"matticbot"}}