{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/jetpack/issues/4897","repository_url":"https://api.github.com/repos/Automattic/jetpack","labels_url":"https://api.github.com/repos/Automattic/jetpack/issues/4897/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/jetpack/issues/4897/comments","events_url":"https://api.github.com/repos/Automattic/jetpack/issues/4897/events","html_url":"https://github.com/Automattic/jetpack/pull/4897","id":172387926,"number":4897,"title":"Fix PHP warnings when user subscribes to comments","user":{"login":"cfinke","id":435369,"avatar_url":"https://avatars.githubusercontent.com/u/435369?v=3","gravatar_id":"","url":"https://api.github.com/users/cfinke","html_url":"https://github.com/cfinke","followers_url":"https://api.github.com/users/cfinke/followers","following_url":"https://api.github.com/users/cfinke/following{/other_user}","gists_url":"https://api.github.com/users/cfinke/gists{/gist_id}","starred_url":"https://api.github.com/users/cfinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfinke/subscriptions","organizations_url":"https://api.github.com/users/cfinke/orgs","repos_url":"https://api.github.com/users/cfinke/repos","events_url":"https://api.github.com/users/cfinke/events{/privacy}","received_events_url":"https://api.github.com/users/cfinke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/jetpack/labels/Subscriptions","name":"Subscriptions","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/jetpack/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"},{"url":"https://api.github.com/repos/Automattic/jetpack/labels/[Type]%20Bug","name":"[Type] Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Automattic/jetpack/milestones/54","html_url":"https://github.com/Automattic/jetpack/milestones/4.4","labels_url":"https://api.github.com/repos/Automattic/jetpack/milestones/54/labels","id":1869985,"number":54,"title":"4.4","description":"","creator":{"login":"richardmuscat","id":2287740,"avatar_url":"https://avatars.githubusercontent.com/u/2287740?v=3","gravatar_id":"","url":"https://api.github.com/users/richardmuscat","html_url":"https://github.com/richardmuscat","followers_url":"https://api.github.com/users/richardmuscat/followers","following_url":"https://api.github.com/users/richardmuscat/following{/other_user}","gists_url":"https://api.github.com/users/richardmuscat/gists{/gist_id}","starred_url":"https://api.github.com/users/richardmuscat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardmuscat/subscriptions","organizations_url":"https://api.github.com/users/richardmuscat/orgs","repos_url":"https://api.github.com/users/richardmuscat/repos","events_url":"https://api.github.com/users/richardmuscat/events{/privacy}","received_events_url":"https://api.github.com/users/richardmuscat/received_events","type":"User","site_admin":false},"open_issues":252,"closed_issues":6,"state":"open","created_at":"2016-07-07T13:38:22Z","updated_at":"2016-08-22T07:53:18Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-08-22T07:45:04Z","updated_at":"2016-08-22T08:36:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/jetpack/pulls/4897","html_url":"https://github.com/Automattic/jetpack/pull/4897","diff_url":"https://github.com/Automattic/jetpack/pull/4897.diff","patch_url":"https://github.com/Automattic/jetpack/pull/4897.patch"},"body":"Fixes #3339. \r\n\r\n#### Changes proposed in this Pull Request:\r\n\r\nReported in #3339, PHP warnings are generated when a user subscribes to comments, and the cookie is set with a null value instead of the expected post ID, making the cookie useless since the check in `comment_subscribe_init()` will never pass.\r\n\r\nThis patch fixes the reference to the post ID, and it saves the \"Subscribe to all comments\" value for each post separately. Previously, if a user subscribed to comments on post 1, then commented on post 2 and did not subscribe to comments on it, the checkbox on post 1 would remain unchecked. Now, both checkboxes will have the appropriate state.\r\n\r\nThis will increase the number of cookies set for users that subscribe to comments on many individual posts. We may wish to revisit the ~1-year cookie expiration limit.\r\n\r\n#### Testing instructions:\r\n1. Comment on a post. Leave both subscription checkboxes unchecked. Observe no PHP warnings, and both boxes remain unchecked.\r\n1. Comment on a post. Check only the comments subscription checkbox. Observe no PHP warnings, and only the comment checkbox is checked. Visit another post. Observe that the comment checkbox is not checked.\r\n1. Comment on a different post. Check both subscription checkboxes. Observe no PHP warnings, and both checkboxes should remain checked. Visit the post commented on in the previous step. Observe both checkboxes are now checked.\r\n1. Re-comment on the first post, and uncheck both subscription checkboxes. Observe no PHP warnings, and both checkboxes should now be unchecked. Visit the second post commented on above, and observe that the comment subscription box is checked."},"comment":{"url":"https://api.github.com/repos/Automattic/jetpack/issues/comments/241347042","html_url":"https://github.com/Automattic/jetpack/pull/4897#issuecomment-241347042","issue_url":"https://api.github.com/repos/Automattic/jetpack/issues/4897","id":241347042,"user":{"login":"cfinke","id":435369,"avatar_url":"https://avatars.githubusercontent.com/u/435369?v=3","gravatar_id":"","url":"https://api.github.com/users/cfinke","html_url":"https://github.com/cfinke","followers_url":"https://api.github.com/users/cfinke/followers","following_url":"https://api.github.com/users/cfinke/following{/other_user}","gists_url":"https://api.github.com/users/cfinke/gists{/gist_id}","starred_url":"https://api.github.com/users/cfinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfinke/subscriptions","organizations_url":"https://api.github.com/users/cfinke/orgs","repos_url":"https://api.github.com/users/cfinke/repos","events_url":"https://api.github.com/users/cfinke/events{/privacy}","received_events_url":"https://api.github.com/users/cfinke/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T08:36:00Z","updated_at":"2016-08-22T08:36:00Z","body":"One of the checks failed, but it looks unrelated to this changeset."}}
{"actor":{"display_login":"cfinke"}}