{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/app/pulls/comments/35592049","id":35592049,"diff_hunk":"@@ -35,7 +35,7 @@\n  * Int Serialized record version.\n  * @ingroup Constants\n  */\n-define( 'MW_USER_VERSION', 8 );\n+define( 'MW_USER_VERSION', 9 );","path":"includes/User.php","position":5,"original_position":5,"commit_id":"9bad1cefaea4c3f12e7ea90355cb6b9eea0632e4","original_commit_id":"9bad1cefaea4c3f12e7ea90355cb6b9eea0632e4","user":{"login":"drsnyder","id":21621,"avatar_url":"https://avatars.githubusercontent.com/u/21621?v=3","gravatar_id":"","url":"https://api.github.com/users/drsnyder","html_url":"https://github.com/drsnyder","followers_url":"https://api.github.com/users/drsnyder/followers","following_url":"https://api.github.com/users/drsnyder/following{/other_user}","gists_url":"https://api.github.com/users/drsnyder/gists{/gist_id}","starred_url":"https://api.github.com/users/drsnyder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drsnyder/subscriptions","organizations_url":"https://api.github.com/users/drsnyder/orgs","repos_url":"https://api.github.com/users/drsnyder/repos","events_url":"https://api.github.com/users/drsnyder/events{/privacy}","received_events_url":"https://api.github.com/users/drsnyder/received_events","type":"User","site_admin":false},"body":"What is this used for?","created_at":"2015-07-27T21:53:59Z","updated_at":"2015-07-27T21:53:59Z","html_url":"https://github.com/Wikia/app/pull/7939#discussion_r35592049","pull_request_url":"https://api.github.com/repos/Wikia/app/pulls/7939","_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments/35592049"},"html":{"href":"https://github.com/Wikia/app/pull/7939#discussion_r35592049"},"pull_request":{"href":"https://api.github.com/repos/Wikia/app/pulls/7939"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/app/pulls/7939","id":40947891,"html_url":"https://github.com/Wikia/app/pull/7939","diff_url":"https://github.com/Wikia/app/pull/7939.diff","patch_url":"https://github.com/Wikia/app/pull/7939.patch","issue_url":"https://api.github.com/repos/Wikia/app/issues/7939","number":7939,"state":"open","locked":false,"title":"Attributes on Special:Preferences","user":{"login":"nmonterroso","id":325800,"avatar_url":"https://avatars.githubusercontent.com/u/325800?v=3","gravatar_id":"","url":"https://api.github.com/users/nmonterroso","html_url":"https://github.com/nmonterroso","followers_url":"https://api.github.com/users/nmonterroso/followers","following_url":"https://api.github.com/users/nmonterroso/following{/other_user}","gists_url":"https://api.github.com/users/nmonterroso/gists{/gist_id}","starred_url":"https://api.github.com/users/nmonterroso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmonterroso/subscriptions","organizations_url":"https://api.github.com/users/nmonterroso/orgs","repos_url":"https://api.github.com/users/nmonterroso/repos","events_url":"https://api.github.com/users/nmonterroso/events{/privacy}","received_events_url":"https://api.github.com/users/nmonterroso/received_events","type":"User","site_admin":false},"body":"@Wikia/services-team \r\nhttps://wikia-inc.atlassian.net/browse/SERVICES-536\r\n\r\nThere are some attributes on Special:Preferences, so when `$user->setGlobalPreference()` was called, the save would fail (because the preference is not on the whitelist). This PR adds a list of attributes to `Preferences.php` to account for that possibility.\r\n\r\nAlso, because all a user's entries in `user_properties` are deleted in `User->saveOptions`, it's possible that:\r\n\r\n```php\r\n$user->setGlobalPreference('someAttribute', 'foo'); // this won't work, 'foo' isn't on the whitelist\r\n$user->saveOptions();\r\n\r\n// in saveOptions\r\n$dbw->delete( 'user_properties', array( 'up_user' => $this->getId() ), __METHOD__ );\r\n// attribute 'foo' is now deleted, but wasn't saved by `setGlobalPreference`\r\n$dbw->insert(...); // 'foo' isn't here either, since it's managed by the UserPreference service\r\n```\r\n\r\nThis also changes the semantics of `$user->saveOptions` to only delete options when they are equal to the default value for that option. This way, a bug with the above scenario will manifest as \"this preference isn't being updated\" instead of \"this preference is getting deleted\"\r\n\r\nRequires the change in Wikia/config#1203 for the whitelist","created_at":"2015-07-27T20:52:15Z","updated_at":"2015-07-27T21:53:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dcae5c125f4abe386be61653056371ad9de2666","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/app/pulls/7939/commits","review_comments_url":"https://api.github.com/repos/Wikia/app/pulls/7939/comments","review_comment_url":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/app/issues/7939/comments","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/9bad1cefaea4c3f12e7ea90355cb6b9eea0632e4","head":{"label":"Wikia:SERVICES-536","ref":"SERVICES-536","sha":"9bad1cefaea4c3f12e7ea90355cb6b9eea0632e4","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","created_at":"2012-08-23T20:55:58Z","updated_at":"2015-07-06T11:29:51Z","pushed_at":"2015-07-27T21:17:27Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":1479058,"stargazers_count":79,"watchers_count":79,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":67,"forks":63,"open_issues":67,"watchers":79,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"f65a55ce801f8f2290b3d4845ea6bbabe3dac539","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","created_at":"2012-08-23T20:55:58Z","updated_at":"2015-07-06T11:29:51Z","pushed_at":"2015-07-27T21:17:27Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":1479058,"stargazers_count":79,"watchers_count":79,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":67,"forks":63,"open_issues":67,"watchers":79,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/7939"},"html":{"href":"https://github.com/Wikia/app/pull/7939"},"issue":{"href":"https://api.github.com/repos/Wikia/app/issues/7939"},"comments":{"href":"https://api.github.com/repos/Wikia/app/issues/7939/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/app/pulls/7939/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/app/pulls/7939/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/app/statuses/9bad1cefaea4c3f12e7ea90355cb6b9eea0632e4"}}}}