{"action":"created","comment":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments/220985412","pull_request_review_id":159525329,"id":220985412,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDk4NTQxMg==","diff_hunk":"@@ -0,0 +1,104 @@\n+<?php\n+/**\n+ * 2007-2018 PrestaShop.\n+ *\n+ * NOTICE OF LICENSE\n+ *\n+ * This source file is subject to the Open Software License (OSL 3.0)\n+ * that is bundled with this package in the file LICENSE.txt.\n+ * It is also available through the world-wide-web at this URL:\n+ * https://opensource.org/licenses/OSL-3.0\n+ * If you did not receive a copy of the license and are unable to\n+ * obtain it through the world-wide-web, please send an email\n+ * to license@prestashop.com so we can send you a copy immediately.\n+ *\n+ * DISCLAIMER\n+ *\n+ * Do not edit or add to this file if you wish to upgrade PrestaShop to newer\n+ * versions in the future. If you wish to customize PrestaShop for your\n+ * needs please refer to http://www.prestashop.com for more information.\n+ *\n+ * @author    PrestaShop SA <contact@prestashop.com>\n+ * @copyright 2007-2018 PrestaShop SA\n+ * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)\n+ * International Registered Trademark & Property of PrestaShop SA\n+ */\n+\n+namespace PrestaShop\\PrestaShop\\Adapter\\Category\\Image;\n+\n+use ImageManager;\n+use PrestaShop\\PrestaShop\\Adapter\\LegacyContext;\n+\n+/**\n+ * Class CategoryThumbnailRetriever.\n+ */\n+class CategoryThumbnailRetriever\n+{\n+    /**\n+     * @var LegacyContext\n+     */\n+    private $legacyContext;\n+\n+    /**\n+     * @param LegacyContext $legacyContext\n+     */\n+    public function __construct(LegacyContext $legacyContext)\n+    {\n+        $this->legacyContext = $legacyContext;\n+    }\n+\n+    /**\n+     * @param int $categoryId\n+     *\n+     * @return string\n+     */\n+    public function retrieve($categoryId)\n+    {\n+        $imageType = 'jpg';\n+        $tableName = 'category';\n+        $imageDir = 'c';\n+        $imagePath = $this->getImagePath($categoryId, $imageType, $imageDir);\n+\n+        $thumbnailCachedImageName = $this->makeCachedImageName($categoryId, $imageType, $tableName);\n+        $imageTag = ImageManager::thumbnail(\n+            $imagePath,\n+            $thumbnailCachedImageName,\n+            45,\n+            $imageType\n+        );\n+\n+        // because legacy uses relative path to reach a directory under root directory...\n+        $replacement = 'src=\"' . $this->legacyContext->getRootUrl();\n+        $imageTag = preg_replace('/src=\"(\\\\.\\\\.\\\\/)+/', $replacement, $imageTag);\n+\n+        preg_match('@src=\"([^\"]+)\"@', $imageTag, $path);","path":"src/Adapter/Category/Image/CategoryThumbnailRetriever.php","position":74,"original_position":74,"commit_id":"49bc38dfa6309f5d8cbcec3bc610e87c6ac2c303","original_commit_id":"49bc38dfa6309f5d8cbcec3bc610e87c6ac2c303","user":{"login":"PierreRambaud","id":1462701,"node_id":"MDQ6VXNlcjE0NjI3MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1462701?v=4","gravatar_id":"","url":"https://api.github.com/users/PierreRambaud","html_url":"https://github.com/PierreRambaud","followers_url":"https://api.github.com/users/PierreRambaud/followers","following_url":"https://api.github.com/users/PierreRambaud/following{/other_user}","gists_url":"https://api.github.com/users/PierreRambaud/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreRambaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreRambaud/subscriptions","organizations_url":"https://api.github.com/users/PierreRambaud/orgs","repos_url":"https://api.github.com/users/PierreRambaud/repos","events_url":"https://api.github.com/users/PierreRambaud/events{/privacy}","received_events_url":"https://api.github.com/users/PierreRambaud/received_events","type":"User","site_admin":false},"body":"see this regex twice at least, should be a const or a generic function.","created_at":"2018-09-27T16:09:19Z","updated_at":"2018-09-27T16:09:19Z","html_url":"https://github.com/PrestaShop/PrestaShop/pull/10408#discussion_r220985412","pull_request_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments/220985412"},"html":{"href":"https://github.com/PrestaShop/PrestaShop/pull/10408#discussion_r220985412"},"pull_request":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408"}}},"pull_request":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408","id":215012525,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MDEyNTI1","html_url":"https://github.com/PrestaShop/PrestaShop/pull/10408","diff_url":"https://github.com/PrestaShop/PrestaShop/pull/10408.diff","patch_url":"https://github.com/PrestaShop/PrestaShop/pull/10408.patch","issue_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/10408","number":10408,"state":"open","locked":false,"title":"[WIP] Migrate Categories Add/Edit actions","user":{"login":"sarjon","id":15143151,"node_id":"MDQ6VXNlcjE1MTQzMTUx","avatar_url":"https://avatars3.githubusercontent.com/u/15143151?v=4","gravatar_id":"","url":"https://api.github.com/users/sarjon","html_url":"https://github.com/sarjon","followers_url":"https://api.github.com/users/sarjon/followers","following_url":"https://api.github.com/users/sarjon/following{/other_user}","gists_url":"https://api.github.com/users/sarjon/gists{/gist_id}","starred_url":"https://api.github.com/users/sarjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarjon/subscriptions","organizations_url":"https://api.github.com/users/sarjon/orgs","repos_url":"https://api.github.com/users/sarjon/repos","events_url":"https://api.github.com/users/sarjon/events{/privacy}","received_events_url":"https://api.github.com/users/sarjon/received_events","type":"User","site_admin":false},"body":":warning: Its still \"WIP\" do not review it yet! :warning: \r\n\r\n| Questions     | Answers\r\n| ------------- | -------------------------------------------------------\r\n| Branch?       | develop\r\n| Description?  | This PR migrates Categories Add & Edit actions.\r\n| Type?         | new feature\r\n| Category?     | BO\r\n| BC breaks?    | yes (overrides)\r\n| Deprecations? | no\r\n| Fixed ticket? | https://github.com/PrestaShop/PrestaShop/issues/10194\r\n| How to test?  | Access \"Categories\" page in BO. Actions \"Add new root category\", \"Add new category\" and \"Edit\" are now migrated and should work the same as before.\r\n\r\n<!-- Click the form's \"Preview\" button to make sure the table is functional in GitHub. Thank you! -->\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/prestashop/prestashop/10408)\n<!-- Reviewable:end -->\n","created_at":"2018-09-12T15:53:14Z","updated_at":"2018-09-27T16:09:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51330fe67eaebce58facd44311b20b926e4fe3a7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":982530767,"node_id":"MDU6TGFiZWw5ODI1MzA3Njc=","url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels/Feature","name":"Feature","color":"d4c5f9","default":false},{"id":904910825,"node_id":"MDU6TGFiZWw5MDQ5MTA4MjU=","url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels/develop","name":"develop","color":"6270ea","default":false},{"id":1039184119,"node_id":"MDU6TGFiZWwxMDM5MTg0MTE5","url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels/migration","name":"migration","color":"06e032","default":false},{"id":418809033,"node_id":"MDU6TGFiZWw0MTg4MDkwMzM=","url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels/waiting%20for%20wording","name":"waiting for wording","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408/commits","review_comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408/comments","review_comment_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/10408/comments","statuses_url":"https://api.github.com/repos/PrestaShop/PrestaShop/statuses/49bc38dfa6309f5d8cbcec3bc610e87c6ac2c303","head":{"label":"sarjon:migrate/categories-crud","ref":"migrate/categories-crud","sha":"49bc38dfa6309f5d8cbcec3bc610e87c6ac2c303","user":{"login":"sarjon","id":15143151,"node_id":"MDQ6VXNlcjE1MTQzMTUx","avatar_url":"https://avatars3.githubusercontent.com/u/15143151?v=4","gravatar_id":"","url":"https://api.github.com/users/sarjon","html_url":"https://github.com/sarjon","followers_url":"https://api.github.com/users/sarjon/followers","following_url":"https://api.github.com/users/sarjon/following{/other_user}","gists_url":"https://api.github.com/users/sarjon/gists{/gist_id}","starred_url":"https://api.github.com/users/sarjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarjon/subscriptions","organizations_url":"https://api.github.com/users/sarjon/orgs","repos_url":"https://api.github.com/users/sarjon/repos","events_url":"https://api.github.com/users/sarjon/events{/privacy}","received_events_url":"https://api.github.com/users/sarjon/received_events","type":"User","site_admin":false},"repo":{"id":77449609,"node_id":"MDEwOlJlcG9zaXRvcnk3NzQ0OTYwOQ==","name":"PrestaShop","full_name":"sarjon/PrestaShop","private":false,"owner":{"login":"sarjon","id":15143151,"node_id":"MDQ6VXNlcjE1MTQzMTUx","avatar_url":"https://avatars3.githubusercontent.com/u/15143151?v=4","gravatar_id":"","url":"https://api.github.com/users/sarjon","html_url":"https://github.com/sarjon","followers_url":"https://api.github.com/users/sarjon/followers","following_url":"https://api.github.com/users/sarjon/following{/other_user}","gists_url":"https://api.github.com/users/sarjon/gists{/gist_id}","starred_url":"https://api.github.com/users/sarjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarjon/subscriptions","organizations_url":"https://api.github.com/users/sarjon/orgs","repos_url":"https://api.github.com/users/sarjon/repos","events_url":"https://api.github.com/users/sarjon/events{/privacy}","received_events_url":"https://api.github.com/users/sarjon/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sarjon/PrestaShop","description":"PrestaShop offers a free, fully scalable, Open Source e-commerce solution.","fork":true,"url":"https://api.github.com/repos/sarjon/PrestaShop","forks_url":"https://api.github.com/repos/sarjon/PrestaShop/forks","keys_url":"https://api.github.com/repos/sarjon/PrestaShop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sarjon/PrestaShop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sarjon/PrestaShop/teams","hooks_url":"https://api.github.com/repos/sarjon/PrestaShop/hooks","issue_events_url":"https://api.github.com/repos/sarjon/PrestaShop/issues/events{/number}","events_url":"https://api.github.com/repos/sarjon/PrestaShop/events","assignees_url":"https://api.github.com/repos/sarjon/PrestaShop/assignees{/user}","branches_url":"https://api.github.com/repos/sarjon/PrestaShop/branches{/branch}","tags_url":"https://api.github.com/repos/sarjon/PrestaShop/tags","blobs_url":"https://api.github.com/repos/sarjon/PrestaShop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sarjon/PrestaShop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sarjon/PrestaShop/git/refs{/sha}","trees_url":"https://api.github.com/repos/sarjon/PrestaShop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sarjon/PrestaShop/statuses/{sha}","languages_url":"https://api.github.com/repos/sarjon/PrestaShop/languages","stargazers_url":"https://api.github.com/repos/sarjon/PrestaShop/stargazers","contributors_url":"https://api.github.com/repos/sarjon/PrestaShop/contributors","subscribers_url":"https://api.github.com/repos/sarjon/PrestaShop/subscribers","subscription_url":"https://api.github.com/repos/sarjon/PrestaShop/subscription","commits_url":"https://api.github.com/repos/sarjon/PrestaShop/commits{/sha}","git_commits_url":"https://api.github.com/repos/sarjon/PrestaShop/git/commits{/sha}","comments_url":"https://api.github.com/repos/sarjon/PrestaShop/comments{/number}","issue_comment_url":"https://api.github.com/repos/sarjon/PrestaShop/issues/comments{/number}","contents_url":"https://api.github.com/repos/sarjon/PrestaShop/contents/{+path}","compare_url":"https://api.github.com/repos/sarjon/PrestaShop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sarjon/PrestaShop/merges","archive_url":"https://api.github.com/repos/sarjon/PrestaShop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sarjon/PrestaShop/downloads","issues_url":"https://api.github.com/repos/sarjon/PrestaShop/issues{/number}","pulls_url":"https://api.github.com/repos/sarjon/PrestaShop/pulls{/number}","milestones_url":"https://api.github.com/repos/sarjon/PrestaShop/milestones{/number}","notifications_url":"https://api.github.com/repos/sarjon/PrestaShop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sarjon/PrestaShop/labels{/name}","releases_url":"https://api.github.com/repos/sarjon/PrestaShop/releases{/id}","deployments_url":"https://api.github.com/repos/sarjon/PrestaShop/deployments","created_at":"2016-12-27T11:12:19Z","updated_at":"2018-09-26T13:14:17Z","pushed_at":"2018-09-27T15:55:39Z","git_url":"git://github.com/sarjon/PrestaShop.git","ssh_url":"git@github.com:sarjon/PrestaShop.git","clone_url":"https://github.com/sarjon/PrestaShop.git","svn_url":"https://github.com/sarjon/PrestaShop","homepage":"http://www.prestashop.com/","size":334534,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PrestaShop:develop","ref":"develop","sha":"d43e37b4c6ac15467acbf20453b44975f3f8e7f5","user":{"login":"PrestaShop","id":2815696,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTU2OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2815696?v=4","gravatar_id":"","url":"https://api.github.com/users/PrestaShop","html_url":"https://github.com/PrestaShop","followers_url":"https://api.github.com/users/PrestaShop/followers","following_url":"https://api.github.com/users/PrestaShop/following{/other_user}","gists_url":"https://api.github.com/users/PrestaShop/gists{/gist_id}","starred_url":"https://api.github.com/users/PrestaShop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrestaShop/subscriptions","organizations_url":"https://api.github.com/users/PrestaShop/orgs","repos_url":"https://api.github.com/users/PrestaShop/repos","events_url":"https://api.github.com/users/PrestaShop/events{/privacy}","received_events_url":"https://api.github.com/users/PrestaShop/received_events","type":"Organization","site_admin":false},"repo":{"id":6763587,"node_id":"MDEwOlJlcG9zaXRvcnk2NzYzNTg3","name":"PrestaShop","full_name":"PrestaShop/PrestaShop","private":false,"owner":{"login":"PrestaShop","id":2815696,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MTU2OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2815696?v=4","gravatar_id":"","url":"https://api.github.com/users/PrestaShop","html_url":"https://github.com/PrestaShop","followers_url":"https://api.github.com/users/PrestaShop/followers","following_url":"https://api.github.com/users/PrestaShop/following{/other_user}","gists_url":"https://api.github.com/users/PrestaShop/gists{/gist_id}","starred_url":"https://api.github.com/users/PrestaShop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrestaShop/subscriptions","organizations_url":"https://api.github.com/users/PrestaShop/orgs","repos_url":"https://api.github.com/users/PrestaShop/repos","events_url":"https://api.github.com/users/PrestaShop/events{/privacy}","received_events_url":"https://api.github.com/users/PrestaShop/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/PrestaShop/PrestaShop","description":"PrestaShop offers a fully scalable open source ecommerce solution.","fork":false,"url":"https://api.github.com/repos/PrestaShop/PrestaShop","forks_url":"https://api.github.com/repos/PrestaShop/PrestaShop/forks","keys_url":"https://api.github.com/repos/PrestaShop/PrestaShop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PrestaShop/PrestaShop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PrestaShop/PrestaShop/teams","hooks_url":"https://api.github.com/repos/PrestaShop/PrestaShop/hooks","issue_events_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/events{/number}","events_url":"https://api.github.com/repos/PrestaShop/PrestaShop/events","assignees_url":"https://api.github.com/repos/PrestaShop/PrestaShop/assignees{/user}","branches_url":"https://api.github.com/repos/PrestaShop/PrestaShop/branches{/branch}","tags_url":"https://api.github.com/repos/PrestaShop/PrestaShop/tags","blobs_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/refs{/sha}","trees_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PrestaShop/PrestaShop/statuses/{sha}","languages_url":"https://api.github.com/repos/PrestaShop/PrestaShop/languages","stargazers_url":"https://api.github.com/repos/PrestaShop/PrestaShop/stargazers","contributors_url":"https://api.github.com/repos/PrestaShop/PrestaShop/contributors","subscribers_url":"https://api.github.com/repos/PrestaShop/PrestaShop/subscribers","subscription_url":"https://api.github.com/repos/PrestaShop/PrestaShop/subscription","commits_url":"https://api.github.com/repos/PrestaShop/PrestaShop/commits{/sha}","git_commits_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/commits{/sha}","comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/comments{/number}","issue_comment_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/comments{/number}","contents_url":"https://api.github.com/repos/PrestaShop/PrestaShop/contents/{+path}","compare_url":"https://api.github.com/repos/PrestaShop/PrestaShop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PrestaShop/PrestaShop/merges","archive_url":"https://api.github.com/repos/PrestaShop/PrestaShop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PrestaShop/PrestaShop/downloads","issues_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues{/number}","pulls_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls{/number}","milestones_url":"https://api.github.com/repos/PrestaShop/PrestaShop/milestones{/number}","notifications_url":"https://api.github.com/repos/PrestaShop/PrestaShop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels{/name}","releases_url":"https://api.github.com/repos/PrestaShop/PrestaShop/releases{/id}","deployments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/deployments","created_at":"2012-11-19T16:41:31Z","updated_at":"2018-09-27T08:38:08Z","pushed_at":"2018-09-27T15:55:46Z","git_url":"git://github.com/PrestaShop/PrestaShop.git","ssh_url":"git@github.com:PrestaShop/PrestaShop.git","clone_url":"https://github.com/PrestaShop/PrestaShop.git","svn_url":"https://github.com/PrestaShop/PrestaShop","homepage":"http://www.prestashop.com/","size":367712,"stargazers_count":3189,"watchers_count":3189,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2906,"mirror_url":null,"archived":false,"open_issues_count":1101,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2906,"open_issues":1101,"watchers":3189,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408"},"html":{"href":"https://github.com/PrestaShop/PrestaShop/pull/10408"},"issue":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/10408"},"comments":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/10408/comments"},"review_comments":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408/comments"},"review_comment":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/10408/commits"},"statuses":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/statuses/49bc38dfa6309f5d8cbcec3bc610e87c6ac2c303"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"PierreRambaud"}}