{"action":"created","comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/234083484","pull_request_review_id":175649955,"id":234083484,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDA4MzQ4NA==","diff_hunk":"@@ -33,4 +33,21 @@ public function check_read_permission( $post ) {\n \n \t\treturn parent::check_read_permission( $post );\n \t}\n+\n+\t/**\n+\t * Retrieves the block's schema, conforming to JSON Schema.\n+\t *\n+\t * @since 4.4.0\n+\t *\n+\t * @return array Item schema data.\n+\t */\n+\tpublic function get_item_schema() {\n+\t\t$schema = parent::get_item_schema();\n+\n+\t\t// Allow all contexts to access the raw title and content of a block.","path":"lib/class-wp-rest-blocks-controller.php","position":15,"original_position":15,"commit_id":"24e1d7cec4be5e05e39ed68d17eb681abebf4316","original_commit_id":"24e1d7cec4be5e05e39ed68d17eb681abebf4316","user":{"login":"noisysocks","id":612155,"node_id":"MDQ6VXNlcjYxMjE1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/612155?v=4","gravatar_id":"","url":"https://api.github.com/users/noisysocks","html_url":"https://github.com/noisysocks","followers_url":"https://api.github.com/users/noisysocks/followers","following_url":"https://api.github.com/users/noisysocks/following{/other_user}","gists_url":"https://api.github.com/users/noisysocks/gists{/gist_id}","starred_url":"https://api.github.com/users/noisysocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisysocks/subscriptions","organizations_url":"https://api.github.com/users/noisysocks/orgs","repos_url":"https://api.github.com/users/noisysocks/repos","events_url":"https://api.github.com/users/noisysocks/events{/privacy}","received_events_url":"https://api.github.com/users/noisysocks/received_events","type":"User","site_admin":false},"body":"The reason that `content.raw` doesn't appear in all contexts is because, when declaring the `content.raw` property, the schema specifies `'context' => array( 'edit' )`:\r\n\r\nhttps://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L2016\r\n\r\n`unset()`ing this `context` value means that the property will appear in all contexts.","created_at":"2018-11-16T03:49:42Z","updated_at":"2018-11-16T03:49:42Z","html_url":"https://github.com/WordPress/gutenberg/pull/11891#discussion_r234083484","pull_request_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/234083484"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/11891#discussion_r234083484"},"pull_request":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891"}},"in_reply_to_id":233891843},"pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891","id":231060490,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMDYwNDkw","html_url":"https://github.com/WordPress/gutenberg/pull/11891","diff_url":"https://github.com/WordPress/gutenberg/pull/11891.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/11891.patch","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11891","number":11891,"state":"open","locked":false,"title":"Reusable blocks: Use view context, always include title.raw and content.raw","user":{"login":"noisysocks","id":612155,"node_id":"MDQ6VXNlcjYxMjE1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/612155?v=4","gravatar_id":"","url":"https://api.github.com/users/noisysocks","html_url":"https://github.com/noisysocks","followers_url":"https://api.github.com/users/noisysocks/followers","following_url":"https://api.github.com/users/noisysocks/following{/other_user}","gists_url":"https://api.github.com/users/noisysocks/gists{/gist_id}","starred_url":"https://api.github.com/users/noisysocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisysocks/subscriptions","organizations_url":"https://api.github.com/users/noisysocks/orgs","repos_url":"https://api.github.com/users/noisysocks/repos","events_url":"https://api.github.com/users/noisysocks/events{/privacy}","received_events_url":"https://api.github.com/users/noisysocks/received_events","type":"User","site_admin":false},"body":"Fixes #11343.\r\n\r\nExisting reusable blocks on a post would not render if the user was an author or a contributor. This happened because requests to fetch a single block or post are blocked when ?context=edit is passed and the current user is not an editor.\r\n\r\nThe fix is to stop passing `?context=edit` to block requests, but this causes another problem which is that Gutenberg needs access to both `title.raw` and `content.raw` in the API response.\r\n\r\nWe therefore both stop passing `?context=edit` to block requests *and* modify the blocks API so that `title.raw` and `content.raw` are always provided.\r\n\r\n#### How to test\r\n\r\n1. Create two users, `user1` (any role) and `user2` (author role)\r\n1. Log in as `user1` and create a reusable block\r\n1. Log in as `user2` and create a post using `user1`'s block\r\n1. The block should render correctly.\r\n1. Save the post and refresh the edit screen.\r\n1. The block should again render correctly.\r\n","created_at":"2018-11-15T03:55:36Z","updated_at":"2018-11-16T03:49:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17f21e6f9bcd8609a247ffce54c8ee0612528d80","assignee":null,"assignees":[],"requested_reviewers":[{"login":"peterwilsoncc","id":519727,"node_id":"MDQ6VXNlcjUxOTcyNw==","avatar_url":"https://avatars2.githubusercontent.com/u/519727?v=4","gravatar_id":"","url":"https://api.github.com/users/peterwilsoncc","html_url":"https://github.com/peterwilsoncc","followers_url":"https://api.github.com/users/peterwilsoncc/followers","following_url":"https://api.github.com/users/peterwilsoncc/following{/other_user}","gists_url":"https://api.github.com/users/peterwilsoncc/gists{/gist_id}","starred_url":"https://api.github.com/users/peterwilsoncc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterwilsoncc/subscriptions","organizations_url":"https://api.github.com/users/peterwilsoncc/orgs","repos_url":"https://api.github.com/users/peterwilsoncc/repos","events_url":"https://api.github.com/users/peterwilsoncc/events{/privacy}","received_events_url":"https://api.github.com/users/peterwilsoncc/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":783337752,"node_id":"MDU6TGFiZWw3ODMzMzc3NTI=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Component]%20Reusable%20Blocks","name":"[Component] Reusable Blocks","color":"fbca04","default":false},{"id":531680823,"node_id":"MDU6TGFiZWw1MzE2ODA4MjM=","url":"https://api.github.com/repos/WordPress/gutenberg/labels/[Type]%20Bug","name":"[Type] Bug","color":"d93f0b","default":false}],"milestone":{"url":"https://api.github.com/repos/WordPress/gutenberg/milestones/77","html_url":"https://github.com/WordPress/gutenberg/milestone/77","labels_url":"https://api.github.com/repos/WordPress/gutenberg/milestones/77/labels","id":3823975,"node_id":"MDk6TWlsZXN0b25lMzgyMzk3NQ==","number":77,"title":"4.5","description":"","creator":{"login":"youknowriad","id":272444,"node_id":"MDQ6VXNlcjI3MjQ0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/272444?v=4","gravatar_id":"","url":"https://api.github.com/users/youknowriad","html_url":"https://github.com/youknowriad","followers_url":"https://api.github.com/users/youknowriad/followers","following_url":"https://api.github.com/users/youknowriad/following{/other_user}","gists_url":"https://api.github.com/users/youknowriad/gists{/gist_id}","starred_url":"https://api.github.com/users/youknowriad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youknowriad/subscriptions","organizations_url":"https://api.github.com/users/youknowriad/orgs","repos_url":"https://api.github.com/users/youknowriad/repos","events_url":"https://api.github.com/users/youknowriad/events{/privacy}","received_events_url":"https://api.github.com/users/youknowriad/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":5,"state":"open","created_at":"2018-11-15T10:13:29Z","updated_at":"2018-11-16T03:27:22Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891/commits","review_comments_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891/comments","review_comment_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/11891/comments","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/24e1d7cec4be5e05e39ed68d17eb681abebf4316","head":{"label":"WordPress:fix/reusable-blocks-context","ref":"fix/reusable-blocks-context","sha":"24e1d7cec4be5e05e39ed68d17eb681abebf4316","user":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"node_id":"MDEwOlJlcG9zaXRvcnk4MDg2MjU4NA==","name":"gutenberg","full_name":"WordPress/gutenberg","private":false,"owner":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-11-16T01:43:52Z","pushed_at":"2018-11-16T03:27:23Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/","size":34358,"stargazers_count":3730,"watchers_count":3730,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1040,"mirror_url":null,"archived":false,"open_issues_count":1579,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1040,"open_issues":1579,"watchers":3730,"default_branch":"master"}},"base":{"label":"WordPress:master","ref":"master","sha":"56d09e537966eb2198197813ba74699309f66488","user":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"node_id":"MDEwOlJlcG9zaXRvcnk4MDg2MjU4NA==","name":"gutenberg","full_name":"WordPress/gutenberg","private":false,"owner":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-11-16T01:43:52Z","pushed_at":"2018-11-16T03:27:23Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/","size":34358,"stargazers_count":3730,"watchers_count":3730,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1040,"mirror_url":null,"archived":false,"open_issues_count":1579,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1040,"open_issues":1579,"watchers":3730,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/11891"},"issue":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/11891"},"comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/11891/comments"},"review_comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891/comments"},"review_comment":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/11891/commits"},"statuses":{"href":"https://api.github.com/repos/WordPress/gutenberg/statuses/24e1d7cec4be5e05e39ed68d17eb681abebf4316"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"noisysocks"}}