GitHub PullRequestReviewCommentEvent at 2014-08-27 07:56:33
Repository: thelia
Actor: zzuutt
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/thelia/thelia/pulls/comments/16762196","id":16762196,"diff_hunk":"@@ -222,13 +222,15 @@ protected function createOrder(EventDispatcherInterface $dispatcher, ModelOrder\n             $pse = $cartItem->getProductSaleElements();\n \n             /* check still in stock */\n-            if ($cartItem->getQuantity() > $pse->getQuantity()) {\n+            if ($cartItem->getQuantity() > $pse->getQuantity() && true === ConfigQuery::checkAvailableStock()) {\n                 throw new TheliaProcessException(\"Not enough stock\", TheliaProcessException::CART_ITEM_NOT_ENOUGH_STOCK, $cartItem);\n             }\n \n             /* decrease stock */\n+            $newStock = $pse->getQuantity() - $cartItem->getQuantity();\n+            if($newStock < 0) $newStock = 0; //Forbid negative stock","path":"core/lib/Thelia/Action/Order.php","position":11,"original_position":11,"commit_id":"24e139b06626cd09d79759c51bbcba5248b12287","original_commit_id":"24e139b06626cd09d79759c51bbcba5248b12287","user":{"login":"zzuutt","id":7439945,"avatar_url":"https://avatars.githubusercontent.com/u/7439945?v=2","gravatar_id":"8c5e969e32fb8fc4a4fa5f67dbcc3492","url":"https://api.github.com/users/zzuutt","html_url":"https://github.com/zzuutt","followers_url":"https://api.github.com/users/zzuutt/followers","following_url":"https://api.github.com/users/zzuutt/following{/other_user}","gists_url":"https://api.github.com/users/zzuutt/gists{/gist_id}","starred_url":"https://api.github.com/users/zzuutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzuutt/subscriptions","organizations_url":"https://api.github.com/users/zzuutt/orgs","repos_url":"https://api.github.com/users/zzuutt/repos","events_url":"https://api.github.com/users/zzuutt/events{/privacy}","received_events_url":"https://api.github.com/users/zzuutt/received_events","type":"User","site_admin":false},"body":"this is not a - b but b - a\r\nif b = 0\r\nb - a < 0","created_at":"2014-08-27T07:56:33Z","updated_at":"2014-08-27T07:56:33Z","html_url":"https://github.com/thelia/thelia/pull/648#discussion_r16762196","pull_request_url":"https://api.github.com/repos/thelia/thelia/pulls/648","_links":{"self":{"href":"https://api.github.com/repos/thelia/thelia/pulls/comments/16762196"},"html":{"href":"https://github.com/thelia/thelia/pull/648#discussion_r16762196"},"pull_request":{"href":"https://api.github.com/repos/thelia/thelia/pulls/648"}}},"pull_request":{"url":"https://api.github.com/repos/thelia/thelia/pulls/648","id":20301843,"html_url":"https://github.com/thelia/thelia/pull/648","diff_url":"https://github.com/thelia/thelia/pull/648.diff","patch_url":"https://github.com/thelia/thelia/pull/648.patch","issue_url":"https://api.github.com/repos/thelia/thelia/issues/648","number":648,"state":"open","locked":false,"title":"fix bug at the time of the payment when stock=0 and checkAvailableStock=0","user":{"login":"zzuutt","id":7439945,"avatar_url":"https://avatars.githubusercontent.com/u/7439945?v=2","gravatar_id":"8c5e969e32fb8fc4a4fa5f67dbcc3492","url":"https://api.github.com/users/zzuutt","html_url":"https://github.com/zzuutt","followers_url":"https://api.github.com/users/zzuutt/followers","following_url":"https://api.github.com/users/zzuutt/following{/other_user}","gists_url":"https://api.github.com/users/zzuutt/gists{/gist_id}","starred_url":"https://api.github.com/users/zzuutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzuutt/subscriptions","organizations_url":"https://api.github.com/users/zzuutt/orgs","repos_url":"https://api.github.com/users/zzuutt/repos","events_url":"https://api.github.com/users/zzuutt/events{/privacy}","received_events_url":"https://api.github.com/users/zzuutt/received_events","type":"User","site_admin":false},"body":"if stock=0 and checkAvailableStock=0\r\nand forbid negative stock","created_at":"2014-08-26T11:16:11Z","updated_at":"2014-08-27T07:56:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"300dcca95989038a2a5218c03573c9e3f0b91b89","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thelia/thelia/pulls/648/commits","review_comments_url":"https://api.github.com/repos/thelia/thelia/pulls/648/comments","review_comment_url":"https://api.github.com/repos/thelia/thelia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thelia/thelia/issues/648/comments","statuses_url":"https://api.github.com/repos/thelia/thelia/statuses/24e139b06626cd09d79759c51bbcba5248b12287","head":{"label":"zzuutt:fix-update-stock-with-stock-and-checkAvailableStock-=-0","ref":"fix-update-stock-with-stock-and-checkAvailableStock-=-0","sha":"24e139b06626cd09d79759c51bbcba5248b12287","user":{"login":"zzuutt","id":7439945,"avatar_url":"https://avatars.githubusercontent.com/u/7439945?v=2","gravatar_id":"8c5e969e32fb8fc4a4fa5f67dbcc3492","url":"https://api.github.com/users/zzuutt","html_url":"https://github.com/zzuutt","followers_url":"https://api.github.com/users/zzuutt/followers","following_url":"https://api.github.com/users/zzuutt/following{/other_user}","gists_url":"https://api.github.com/users/zzuutt/gists{/gist_id}","starred_url":"https://api.github.com/users/zzuutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzuutt/subscriptions","organizations_url":"https://api.github.com/users/zzuutt/orgs","repos_url":"https://api.github.com/users/zzuutt/repos","events_url":"https://api.github.com/users/zzuutt/events{/privacy}","received_events_url":"https://api.github.com/users/zzuutt/received_events","type":"User","site_admin":false},"repo":{"id":19277468,"name":"thelia","full_name":"zzuutt/thelia","owner":{"login":"zzuutt","id":7439945,"avatar_url":"https://avatars.githubusercontent.com/u/7439945?v=2","gravatar_id":"8c5e969e32fb8fc4a4fa5f67dbcc3492","url":"https://api.github.com/users/zzuutt","html_url":"https://github.com/zzuutt","followers_url":"https://api.github.com/users/zzuutt/followers","following_url":"https://api.github.com/users/zzuutt/following{/other_user}","gists_url":"https://api.github.com/users/zzuutt/gists{/gist_id}","starred_url":"https://api.github.com/users/zzuutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzuutt/subscriptions","organizations_url":"https://api.github.com/users/zzuutt/orgs","repos_url":"https://api.github.com/users/zzuutt/repos","events_url":"https://api.github.com/users/zzuutt/events{/privacy}","received_events_url":"https://api.github.com/users/zzuutt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zzuutt/thelia","description":"Thelia is an open source tool for creating e-business websites and managing online content. Repo containing the next major version (v2)","fork":true,"url":"https://api.github.com/repos/zzuutt/thelia","forks_url":"https://api.github.com/repos/zzuutt/thelia/forks","keys_url":"https://api.github.com/repos/zzuutt/thelia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zzuutt/thelia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zzuutt/thelia/teams","hooks_url":"https://api.github.com/repos/zzuutt/thelia/hooks","issue_events_url":"https://api.github.com/repos/zzuutt/thelia/issues/events{/number}","events_url":"https://api.github.com/repos/zzuutt/thelia/events","assignees_url":"https://api.github.com/repos/zzuutt/thelia/assignees{/user}","branches_url":"https://api.github.com/repos/zzuutt/thelia/branches{/branch}","tags_url":"https://api.github.com/repos/zzuutt/thelia/tags","blobs_url":"https://api.github.com/repos/zzuutt/thelia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zzuutt/thelia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zzuutt/thelia/git/refs{/sha}","trees_url":"https://api.github.com/repos/zzuutt/thelia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zzuutt/thelia/statuses/{sha}","languages_url":"https://api.github.com/repos/zzuutt/thelia/languages","stargazers_url":"https://api.github.com/repos/zzuutt/thelia/stargazers","contributors_url":"https://api.github.com/repos/zzuutt/thelia/contributors","subscribers_url":"https://api.github.com/repos/zzuutt/thelia/subscribers","subscription_url":"https://api.github.com/repos/zzuutt/thelia/subscription","commits_url":"https://api.github.com/repos/zzuutt/thelia/commits{/sha}","git_commits_url":"https://api.github.com/repos/zzuutt/thelia/git/commits{/sha}","comments_url":"https://api.github.com/repos/zzuutt/thelia/comments{/number}","issue_comment_url":"https://api.github.com/repos/zzuutt/thelia/issues/comments/{number}","contents_url":"https://api.github.com/repos/zzuutt/thelia/contents/{+path}","compare_url":"https://api.github.com/repos/zzuutt/thelia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zzuutt/thelia/merges","archive_url":"https://api.github.com/repos/zzuutt/thelia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zzuutt/thelia/downloads","issues_url":"https://api.github.com/repos/zzuutt/thelia/issues{/number}","pulls_url":"https://api.github.com/repos/zzuutt/thelia/pulls{/number}","milestones_url":"https://api.github.com/repos/zzuutt/thelia/milestones{/number}","notifications_url":"https://api.github.com/repos/zzuutt/thelia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zzuutt/thelia/labels{/name}","releases_url":"https://api.github.com/repos/zzuutt/thelia/releases{/id}","created_at":"2014-04-29T13:30:40Z","updated_at":"2014-07-21T11:59:40Z","pushed_at":"2014-08-27T06:42:23Z","git_url":"git://github.com/zzuutt/thelia.git","ssh_url":"git@github.com:zzuutt/thelia.git","clone_url":"https://github.com/zzuutt/thelia.git","svn_url":"https://github.com/zzuutt/thelia","homepage":"http://thelia.net/v2","size":71383,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thelia:master","ref":"master","sha":"51b43cd76566393e245b99fde8ee8a8d7c9263a1","user":{"login":"thelia","id":2196919,"avatar_url":"https://avatars.githubusercontent.com/u/2196919?v=2","gravatar_id":"122cfc16b848dc3e4dfe5131d06f0fb0","url":"https://api.github.com/users/thelia","html_url":"https://github.com/thelia","followers_url":"https://api.github.com/users/thelia/followers","following_url":"https://api.github.com/users/thelia/following{/other_user}","gists_url":"https://api.github.com/users/thelia/gists{/gist_id}","starred_url":"https://api.github.com/users/thelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelia/subscriptions","organizations_url":"https://api.github.com/users/thelia/orgs","repos_url":"https://api.github.com/users/thelia/repos","events_url":"https://api.github.com/users/thelia/events{/privacy}","received_events_url":"https://api.github.com/users/thelia/received_events","type":"Organization","site_admin":false},"repo":{"id":8863081,"name":"thelia","full_name":"thelia/thelia","owner":{"login":"thelia","id":2196919,"avatar_url":"https://avatars.githubusercontent.com/u/2196919?v=2","gravatar_id":"122cfc16b848dc3e4dfe5131d06f0fb0","url":"https://api.github.com/users/thelia","html_url":"https://github.com/thelia","followers_url":"https://api.github.com/users/thelia/followers","following_url":"https://api.github.com/users/thelia/following{/other_user}","gists_url":"https://api.github.com/users/thelia/gists{/gist_id}","starred_url":"https://api.github.com/users/thelia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelia/subscriptions","organizations_url":"https://api.github.com/users/thelia/orgs","repos_url":"https://api.github.com/users/thelia/repos","events_url":"https://api.github.com/users/thelia/events{/privacy}","received_events_url":"https://api.github.com/users/thelia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thelia/thelia","description":"Thelia is an open source tool for creating e-business websites and managing online content. Repo containing the new major version (v2)","fork":false,"url":"https://api.github.com/repos/thelia/thelia","forks_url":"https://api.github.com/repos/thelia/thelia/forks","keys_url":"https://api.github.com/repos/thelia/thelia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thelia/thelia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thelia/thelia/teams","hooks_url":"https://api.github.com/repos/thelia/thelia/hooks","issue_events_url":"https://api.github.com/repos/thelia/thelia/issues/events{/number}","events_url":"https://api.github.com/repos/thelia/thelia/events","assignees_url":"https://api.github.com/repos/thelia/thelia/assignees{/user}","branches_url":"https://api.github.com/repos/thelia/thelia/branches{/branch}","tags_url":"https://api.github.com/repos/thelia/thelia/tags","blobs_url":"https://api.github.com/repos/thelia/thelia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thelia/thelia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thelia/thelia/git/refs{/sha}","trees_url":"https://api.github.com/repos/thelia/thelia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thelia/thelia/statuses/{sha}","languages_url":"https://api.github.com/repos/thelia/thelia/languages","stargazers_url":"https://api.github.com/repos/thelia/thelia/stargazers","contributors_url":"https://api.github.com/repos/thelia/thelia/contributors","subscribers_url":"https://api.github.com/repos/thelia/thelia/subscribers","subscription_url":"https://api.github.com/repos/thelia/thelia/subscription","commits_url":"https://api.github.com/repos/thelia/thelia/commits{/sha}","git_commits_url":"https://api.github.com/repos/thelia/thelia/git/commits{/sha}","comments_url":"https://api.github.com/repos/thelia/thelia/comments{/number}","issue_comment_url":"https://api.github.com/repos/thelia/thelia/issues/comments/{number}","contents_url":"https://api.github.com/repos/thelia/thelia/contents/{+path}","compare_url":"https://api.github.com/repos/thelia/thelia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thelia/thelia/merges","archive_url":"https://api.github.com/repos/thelia/thelia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thelia/thelia/downloads","issues_url":"https://api.github.com/repos/thelia/thelia/issues{/number}","pulls_url":"https://api.github.com/repos/thelia/thelia/pulls{/number}","milestones_url":"https://api.github.com/repos/thelia/thelia/milestones{/number}","notifications_url":"https://api.github.com/repos/thelia/thelia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thelia/thelia/labels{/name}","releases_url":"https://api.github.com/repos/thelia/thelia/releases{/id}","created_at":"2013-03-18T20:10:36Z","updated_at":"2014-08-26T21:50:08Z","pushed_at":"2014-08-27T07:24:02Z","git_url":"git://github.com/thelia/thelia.git","ssh_url":"git@github.com:thelia/thelia.git","clone_url":"https://github.com/thelia/thelia.git","svn_url":"https://github.com/thelia/thelia","homepage":"http://thelia.net","size":87487,"stargazers_count":193,"watchers_count":193,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":68,"mirror_url":null,"open_issues_count":61,"forks":68,"open_issues":61,"watchers":193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thelia/thelia/pulls/648"},"html":{"href":"https://github.com/thelia/thelia/pull/648"},"issue":{"href":"https://api.github.com/repos/thelia/thelia/issues/648"},"comments":{"href":"https://api.github.com/repos/thelia/thelia/issues/648/comments"},"review_comments":{"href":"https://api.github.com/repos/thelia/thelia/pulls/648/comments"},"review_comment":{"href":"https://api.github.com/repos/thelia/thelia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thelia/thelia/pulls/648/commits"},"statuses":{"href":"https://api.github.com/repos/thelia/thelia/statuses/24e139b06626cd09d79759c51bbcba5248b12287"}}}}