GitHub PullRequestReviewCommentEvent at 2014-06-17 11:58:15
Repository: ezpublish-kernel
Actor: andrerom
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/13854632","id":13854632,"diff_hunk":"@@ -273,4 +303,46 @@ public function getArchivedBlockItems( Block $block )\n \n         return $this->archivedBlockItems[$block] = $this->getStorageGateway()->getArchivedBlockItems( $block );\n     }\n+\n+    /**\n+     * Returns Block object for the given $id.\n+     *\n+     * @throws \\eZ\\Publish\\API\\Repository\\Exceptions\\NotFoundException If block could not be found.\n+     *\n+     * @param int|string $id\n+     *\n+     * @return \\eZ\\Publish\\Core\\FieldType\\Page\\Parts\\Block\n+     */\n+    public function getBlockById( $id )\n+    {\n+        if ( isset( $this->blocksById[$id] ) )\n+        {\n+            return $this->blocksById[$id];\n+        }\n+\n+        $locationId = $this->getStorageGateway()->getLocationIdByBlockId( $id );","path":"eZ/Publish/Core/FieldType/Page/PageService.php","position":79,"original_position":79,"commit_id":"e67274ce76fd863642e5051a742168196eee3a04","original_commit_id":"e67274ce76fd863642e5051a742168196eee3a04","user":{"login":"andrerom","id":289757,"avatar_url":"https://avatars.githubusercontent.com/u/289757?","gravatar_id":"90bed9bc49929b9eaf0764d20429f5b3","url":"https://api.github.com/users/andrerom","html_url":"https://github.com/andrerom","followers_url":"https://api.github.com/users/andrerom/followers","following_url":"https://api.github.com/users/andrerom/following{/other_user}","gists_url":"https://api.github.com/users/andrerom/gists{/gist_id}","starred_url":"https://api.github.com/users/andrerom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrerom/subscriptions","organizations_url":"https://api.github.com/users/andrerom/orgs","repos_url":"https://api.github.com/users/andrerom/repos","events_url":"https://api.github.com/users/andrerom/events{/privacy}","received_events_url":"https://api.github.com/users/andrerom/received_events","type":"User","site_admin":false},"body":"Could be getContentIdByBlockId to save a load, and we are supposed to center it around content instead of location probably anyway.","created_at":"2014-06-17T11:58:15Z","updated_at":"2014-06-17T11:58:15Z","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/893#discussion_r13854632","pull_request_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/13854632"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/893#discussion_r13854632"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893","id":17230439,"html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/893","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/893.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/893.patch","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/893","number":893,"state":"open","title":"Fix EZP-23025: Page field type Block can't be rendered using ESI strategy","user":{"login":"pspanja","id":1135425,"avatar_url":"https://avatars.githubusercontent.com/u/1135425?","gravatar_id":"6675614472419f7e62d1afbe9fa6cc31","url":"https://api.github.com/users/pspanja","html_url":"https://github.com/pspanja","followers_url":"https://api.github.com/users/pspanja/followers","following_url":"https://api.github.com/users/pspanja/following{/other_user}","gists_url":"https://api.github.com/users/pspanja/gists{/gist_id}","starred_url":"https://api.github.com/users/pspanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pspanja/subscriptions","organizations_url":"https://api.github.com/users/pspanja/orgs","repos_url":"https://api.github.com/users/pspanja/repos","events_url":"https://api.github.com/users/pspanja/events{/privacy}","received_events_url":"https://api.github.com/users/pspanja/received_events","type":"User","site_admin":false},"body":"This PR resolves issue https://jira.ez.no/browse/EZP-23025\r\n\r\n`PageController::viewBlock()` accepts Block object as first argument, which does not work when using real reverse proxy (Varnish). In order not to introduce BC break, this implements a new controller action `viewBlockById()` which accepts Block id instead of Block object and therefore is usable with ESI strategy in all contexts.\r\n\r\nThe fix required adding `PageService::getBlockById()` method, which loads the Block in a bit roundabout way. Reason for this is that complete Block data can't be loaded from `ezm_block` table alone, instead it needs to be loaded from the XML stored in the field value. This is then done by iterating through fields of the Content of the Location pointed to by `ezm_block.node_id`.\r\n\r\nTests: unit tests and manual tests with Varnish.","created_at":"2014-06-17T11:50:08Z","updated_at":"2014-06-17T11:58:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d72e279aa674487ecc0fa0abd22928e138e53b9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893/commits","review_comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893/comments","review_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/893/comments","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/e67274ce76fd863642e5051a742168196eee3a04","head":{"label":"ezsystems:fix-EZP-23025-ezpage-block-esi","ref":"fix-EZP-23025-ezpage-block-esi","sha":"e67274ce76fd863642e5051a742168196eee3a04","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?","gravatar_id":"dbbdb060113a80091749fe80be36cff7","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":1663890,"name":"ezpublish-kernel","full_name":"ezsystems/ezpublish-kernel","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?","gravatar_id":"dbbdb060113a80091749fe80be36cff7","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/ezpublish-kernel","description":"eZ Publish 5 kernel","fork":false,"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","forks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments/{number}","contents_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/releases{/id}","created_at":"2011-04-26T08:54:24Z","updated_at":"2014-06-17T11:50:08Z","pushed_at":"2014-06-17T11:27:52Z","git_url":"git://github.com/ezsystems/ezpublish-kernel.git","ssh_url":"git@github.com:ezsystems/ezpublish-kernel.git","clone_url":"https://github.com/ezsystems/ezpublish-kernel.git","svn_url":"https://github.com/ezsystems/ezpublish-kernel","homepage":"http://ez.no","size":56521,"stargazers_count":85,"watchers_count":85,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":86,"mirror_url":null,"open_issues_count":32,"forks":86,"open_issues":32,"watchers":85,"default_branch":"master"}},"base":{"label":"ezsystems:master","ref":"master","sha":"8f39d3d8fdec2c44e47d110006be7d8a615fd8ec","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?","gravatar_id":"dbbdb060113a80091749fe80be36cff7","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":1663890,"name":"ezpublish-kernel","full_name":"ezsystems/ezpublish-kernel","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?","gravatar_id":"dbbdb060113a80091749fe80be36cff7","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/ezpublish-kernel","description":"eZ Publish 5 kernel","fork":false,"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","forks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments/{number}","contents_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/releases{/id}","created_at":"2011-04-26T08:54:24Z","updated_at":"2014-06-17T11:50:08Z","pushed_at":"2014-06-17T11:27:52Z","git_url":"git://github.com/ezsystems/ezpublish-kernel.git","ssh_url":"git@github.com:ezsystems/ezpublish-kernel.git","clone_url":"https://github.com/ezsystems/ezpublish-kernel.git","svn_url":"https://github.com/ezsystems/ezpublish-kernel","homepage":"http://ez.no","size":56521,"stargazers_count":85,"watchers_count":85,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":86,"mirror_url":null,"open_issues_count":32,"forks":86,"open_issues":32,"watchers":85,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/893"},"issue":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/893"},"comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/893/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/893/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/e67274ce76fd863642e5051a742168196eee3a04"}}}}