{"action":"opened","number":2977,"pull_request":{"url":"https://api.github.com/repos/sulu/sulu/pulls/2977","id":88876862,"html_url":"https://github.com/sulu/sulu/pull/2977","diff_url":"https://github.com/sulu/sulu/pull/2977.diff","patch_url":"https://github.com/sulu/sulu/pull/2977.patch","issue_url":"https://api.github.com/repos/sulu/sulu/issues/2977","number":2977,"state":"open","locked":false,"title":"Fix sulu.loadUserSettings() when key does not exist","user":{"login":"rupkoe","id":7406696,"avatar_url":"https://avatars.githubusercontent.com/u/7406696?v=3","gravatar_id":"","url":"https://api.github.com/users/rupkoe","html_url":"https://github.com/rupkoe","followers_url":"https://api.github.com/users/rupkoe/followers","following_url":"https://api.github.com/users/rupkoe/following{/other_user}","gists_url":"https://api.github.com/users/rupkoe/gists{/gist_id}","starred_url":"https://api.github.com/users/rupkoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupkoe/subscriptions","organizations_url":"https://api.github.com/users/rupkoe/orgs","repos_url":"https://api.github.com/users/rupkoe/repos","events_url":"https://api.github.com/users/rupkoe/events{/privacy}","received_events_url":"https://api.github.com/users/rupkoe/received_events","type":"User","site_admin":false},"body":"| Q | A\r\n| --- | ---\r\n| Bug fix? | yes\r\n| New feature? | no\r\n| BC breaks? | no\r\n| Deprecations? | no\r\n| Fixed tickets | -\r\n| Related issues/PRs | -\r\n| License | MIT\r\n| Documentation PR | -\r\n\r\n#### What's in this PR?\r\n\r\nFix for sulu-extionsion.js / sulu.loadUserSetting() method.\r\n\r\n#### Why?\r\n\r\nAs (partially) discussed with @danrot in https://sulu-io.slack.com/archives/general/p1476195014001682 \r\n\r\nFixes two problems occurring when trying to get a user setting, which does not exist yet in the DB (and also is not in the dynamic settings in the sandbox):\r\n\r\n1. Wrong call to log method.\r\n\r\n2. Callback is not called when key does not exist in neither sandbox nor DB. This gives a hard time when trying to use method in promises (like with the loadComponentData hook). Looking at the sulu.getUserSetting() method, returning NULL in case of a none-existent key seems to be consistent behavior.\r\n\r\n\r\n","created_at":"2016-10-11T17:36:57Z","updated_at":"2016-10-11T17:36:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sulu/sulu/pulls/2977/commits","review_comments_url":"https://api.github.com/repos/sulu/sulu/pulls/2977/comments","review_comment_url":"https://api.github.com/repos/sulu/sulu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu/sulu/issues/2977/comments","statuses_url":"https://api.github.com/repos/sulu/sulu/statuses/85c1a149376e5239a78fcd237e34518b126da600","head":{"label":"rupkoe:bugfix/admin-load-user-settings","ref":"bugfix/admin-load-user-settings","sha":"85c1a149376e5239a78fcd237e34518b126da600","user":{"login":"rupkoe","id":7406696,"avatar_url":"https://avatars.githubusercontent.com/u/7406696?v=3","gravatar_id":"","url":"https://api.github.com/users/rupkoe","html_url":"https://github.com/rupkoe","followers_url":"https://api.github.com/users/rupkoe/followers","following_url":"https://api.github.com/users/rupkoe/following{/other_user}","gists_url":"https://api.github.com/users/rupkoe/gists{/gist_id}","starred_url":"https://api.github.com/users/rupkoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupkoe/subscriptions","organizations_url":"https://api.github.com/users/rupkoe/orgs","repos_url":"https://api.github.com/users/rupkoe/repos","events_url":"https://api.github.com/users/rupkoe/events{/privacy}","received_events_url":"https://api.github.com/users/rupkoe/received_events","type":"User","site_admin":false},"repo":{"id":70611453,"name":"sulu","full_name":"rupkoe/sulu","owner":{"login":"rupkoe","id":7406696,"avatar_url":"https://avatars.githubusercontent.com/u/7406696?v=3","gravatar_id":"","url":"https://api.github.com/users/rupkoe","html_url":"https://github.com/rupkoe","followers_url":"https://api.github.com/users/rupkoe/followers","following_url":"https://api.github.com/users/rupkoe/following{/other_user}","gists_url":"https://api.github.com/users/rupkoe/gists{/gist_id}","starred_url":"https://api.github.com/users/rupkoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rupkoe/subscriptions","organizations_url":"https://api.github.com/users/rupkoe/orgs","repos_url":"https://api.github.com/users/rupkoe/repos","events_url":"https://api.github.com/users/rupkoe/events{/privacy}","received_events_url":"https://api.github.com/users/rupkoe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rupkoe/sulu","description":"Sulu core bundles & components","fork":true,"url":"https://api.github.com/repos/rupkoe/sulu","forks_url":"https://api.github.com/repos/rupkoe/sulu/forks","keys_url":"https://api.github.com/repos/rupkoe/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rupkoe/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rupkoe/sulu/teams","hooks_url":"https://api.github.com/repos/rupkoe/sulu/hooks","issue_events_url":"https://api.github.com/repos/rupkoe/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/rupkoe/sulu/events","assignees_url":"https://api.github.com/repos/rupkoe/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/rupkoe/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/rupkoe/sulu/tags","blobs_url":"https://api.github.com/repos/rupkoe/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rupkoe/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rupkoe/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/rupkoe/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rupkoe/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/rupkoe/sulu/languages","stargazers_url":"https://api.github.com/repos/rupkoe/sulu/stargazers","contributors_url":"https://api.github.com/repos/rupkoe/sulu/contributors","subscribers_url":"https://api.github.com/repos/rupkoe/sulu/subscribers","subscription_url":"https://api.github.com/repos/rupkoe/sulu/subscription","commits_url":"https://api.github.com/repos/rupkoe/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/rupkoe/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/rupkoe/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/rupkoe/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/rupkoe/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/rupkoe/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rupkoe/sulu/merges","archive_url":"https://api.github.com/repos/rupkoe/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rupkoe/sulu/downloads","issues_url":"https://api.github.com/repos/rupkoe/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/rupkoe/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/rupkoe/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/rupkoe/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rupkoe/sulu/labels{/name}","releases_url":"https://api.github.com/repos/rupkoe/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/rupkoe/sulu/deployments","created_at":"2016-10-11T16:07:55Z","updated_at":"2016-10-11T16:08:03Z","pushed_at":"2016-10-11T17:28:32Z","git_url":"git://github.com/rupkoe/sulu.git","ssh_url":"git@github.com:rupkoe/sulu.git","clone_url":"https://github.com/rupkoe/sulu.git","svn_url":"https://github.com/rupkoe/sulu","homepage":"sulu.io","size":94350,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"sulu:develop","ref":"develop","sha":"dd4c2888e9c817e8d783df09c1811eb718f928a6","user":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"repo":{"id":13678015,"name":"sulu","full_name":"sulu/sulu","owner":{"login":"sulu","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu","html_url":"https://github.com/sulu","followers_url":"https://api.github.com/users/sulu/followers","following_url":"https://api.github.com/users/sulu/following{/other_user}","gists_url":"https://api.github.com/users/sulu/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu/subscriptions","organizations_url":"https://api.github.com/users/sulu/orgs","repos_url":"https://api.github.com/users/sulu/repos","events_url":"https://api.github.com/users/sulu/events{/privacy}","received_events_url":"https://api.github.com/users/sulu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu/sulu","description":"Sulu core bundles & components","fork":false,"url":"https://api.github.com/repos/sulu/sulu","forks_url":"https://api.github.com/repos/sulu/sulu/forks","keys_url":"https://api.github.com/repos/sulu/sulu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu/sulu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu/sulu/teams","hooks_url":"https://api.github.com/repos/sulu/sulu/hooks","issue_events_url":"https://api.github.com/repos/sulu/sulu/issues/events{/number}","events_url":"https://api.github.com/repos/sulu/sulu/events","assignees_url":"https://api.github.com/repos/sulu/sulu/assignees{/user}","branches_url":"https://api.github.com/repos/sulu/sulu/branches{/branch}","tags_url":"https://api.github.com/repos/sulu/sulu/tags","blobs_url":"https://api.github.com/repos/sulu/sulu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu/sulu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu/sulu/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu/sulu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu/sulu/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu/sulu/languages","stargazers_url":"https://api.github.com/repos/sulu/sulu/stargazers","contributors_url":"https://api.github.com/repos/sulu/sulu/contributors","subscribers_url":"https://api.github.com/repos/sulu/sulu/subscribers","subscription_url":"https://api.github.com/repos/sulu/sulu/subscription","commits_url":"https://api.github.com/repos/sulu/sulu/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu/sulu/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu/sulu/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu/sulu/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu/sulu/contents/{+path}","compare_url":"https://api.github.com/repos/sulu/sulu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu/sulu/merges","archive_url":"https://api.github.com/repos/sulu/sulu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu/sulu/downloads","issues_url":"https://api.github.com/repos/sulu/sulu/issues{/number}","pulls_url":"https://api.github.com/repos/sulu/sulu/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu/sulu/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu/sulu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu/sulu/labels{/name}","releases_url":"https://api.github.com/repos/sulu/sulu/releases{/id}","deployments_url":"https://api.github.com/repos/sulu/sulu/deployments","created_at":"2013-10-18T12:57:02Z","updated_at":"2016-09-14T17:36:13Z","pushed_at":"2016-10-11T13:51:29Z","git_url":"git://github.com/sulu/sulu.git","ssh_url":"git@github.com:sulu/sulu.git","clone_url":"https://github.com/sulu/sulu.git","svn_url":"https://github.com/sulu/sulu","homepage":"sulu.io","size":94350,"stargazers_count":147,"watchers_count":147,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":447,"forks":62,"open_issues":447,"watchers":147,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2977"},"html":{"href":"https://github.com/sulu/sulu/pull/2977"},"issue":{"href":"https://api.github.com/repos/sulu/sulu/issues/2977"},"comments":{"href":"https://api.github.com/repos/sulu/sulu/issues/2977/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2977/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu/sulu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu/sulu/pulls/2977/commits"},"statuses":{"href":"https://api.github.com/repos/sulu/sulu/statuses/85c1a149376e5239a78fcd237e34518b126da600"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"rupkoe"}}