{"action":"created","comment":{"url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/comments/243018228","pull_request_review_id":186676227,"id":243018228,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzAxODIyOA==","diff_hunk":"@@ -0,0 +1,36 @@\n+<?php\n+\n+/**\n+ * Post processes contribution confirmation form, the last step in a\n+ * contribution page workflow.\n+ */\n+class CRM_MembershipExtras_Hook_PostProcess_ContributionConfirm {\n+\n+  /**\n+   * Form that is being post processed.\n+   *\n+   * @var \\CRM_Contribute_Form_Contribution_Confirm\n+   */\n+  private $form;\n+\n+  /**\n+   * CRM_MembershipExtras_Hook_PostProcess_ContributionConfirm constructor.\n+   *\n+   * @param \\CRM_Contribute_Form_Contribution_Confirm $form\n+   */\n+  public function __construct(CRM_Contribute_Form_Contribution_Confirm $form) {\n+    $this->form = $form;\n+  }\n+\n+  /**\n+   * Postprocesses form to creaate membership periods.\n+   */\n+  public function postProcess() {\n+    $membershipID = $this->form->_params['membershipID'];","path":"CRM/MembershipExtras/Hook/PostProcess/ContributionConfirm.php","position":29,"original_position":29,"commit_id":"d0d26de987a27d9e901531d74f5fde72f2b915dc","original_commit_id":"d0d26de987a27d9e901531d74f5fde72f2b915dc","user":{"login":"omarabuhussein","id":6275540,"node_id":"MDQ6VXNlcjYyNzU1NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/6275540?v=4","gravatar_id":"","url":"https://api.github.com/users/omarabuhussein","html_url":"https://github.com/omarabuhussein","followers_url":"https://api.github.com/users/omarabuhussein/followers","following_url":"https://api.github.com/users/omarabuhussein/following{/other_user}","gists_url":"https://api.github.com/users/omarabuhussein/gists{/gist_id}","starred_url":"https://api.github.com/users/omarabuhussein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omarabuhussein/subscriptions","organizations_url":"https://api.github.com/users/omarabuhussein/orgs","repos_url":"https://api.github.com/users/omarabuhussein/repos","events_url":"https://api.github.com/users/omarabuhussein/events{/privacy}","received_events_url":"https://api.github.com/users/omarabuhussein/received_events","type":"User","site_admin":false},"body":"would be better to use the CRM_Utils_Array::value in case the membershipID index does not exist","created_at":"2018-12-19T18:02:21Z","updated_at":"2018-12-19T18:16:49Z","html_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras/pull/118#discussion_r243018228","pull_request_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/comments/243018228"},"html":{"href":"https://github.com/compucorp/uk.co.compucorp.membershipextras/pull/118#discussion_r243018228"},"pull_request":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118","id":239584125,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NTg0MTI1","html_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras/pull/118","diff_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras/pull/118.diff","patch_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras/pull/118.patch","issue_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/118","number":118,"state":"open","locked":false,"title":"BASW-324: Create Membership Period on Renewals","user":{"login":"MiyaNoctem","id":21999940,"node_id":"MDQ6VXNlcjIxOTk5OTQw","avatar_url":"https://avatars0.githubusercontent.com/u/21999940?v=4","gravatar_id":"","url":"https://api.github.com/users/MiyaNoctem","html_url":"https://github.com/MiyaNoctem","followers_url":"https://api.github.com/users/MiyaNoctem/followers","following_url":"https://api.github.com/users/MiyaNoctem/following{/other_user}","gists_url":"https://api.github.com/users/MiyaNoctem/gists{/gist_id}","starred_url":"https://api.github.com/users/MiyaNoctem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiyaNoctem/subscriptions","organizations_url":"https://api.github.com/users/MiyaNoctem/orgs","repos_url":"https://api.github.com/users/MiyaNoctem/repos","events_url":"https://api.github.com/users/MiyaNoctem/events{/privacy}","received_events_url":"https://api.github.com/users/MiyaNoctem/received_events","type":"User","site_admin":false},"body":"## Overview\r\nEvery time a membership is renewed, a new membership period should also be created under that membership. Period start date should be today or a day after the last active period end date (whichever is later). Period end date should be period start date plus the length of a full term.\r\n\r\n## Before\r\nPeriods were being created on Membership entity post hook. This had the problem that the dates for the membership were not updated by the time it was run, thus the new period had the same dates as the previous period.\r\n\r\n## After\r\nPeriod creation logic was moved to the MembershipPeriod BAO. This in turn is called after each different form of membership renewal is completed:\r\n\r\n- After a membership is renewed using the \"Renew\" action in the contact's membership Tab.\r\n- After a membership is renewed in the auto-renewal job.\r\n- After a membership is renewed using a Contribution page.\r\n\r\n## Notes\r\nThis PR has also two commits cherry-picked from phase 3 workstream fith a fix for the auto renewal job. See PR #116.","created_at":"2018-12-18T18:14:00Z","updated_at":"2018-12-19T18:16:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48f0d14f0f98242f919e6ad96466dea496e832ab","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118/commits","review_comments_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118/comments","review_comment_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/comments{/number}","comments_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/118/comments","statuses_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/statuses/d0d26de987a27d9e901531d74f5fde72f2b915dc","head":{"label":"compucorp:BASW-324-create-mambership-period-on-renewals","ref":"BASW-324-create-mambership-period-on-renewals","sha":"d0d26de987a27d9e901531d74f5fde72f2b915dc","user":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"repo":{"id":119543283,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk1NDMyODM=","name":"uk.co.compucorp.membershipextras","full_name":"compucorp/uk.co.compucorp.membershipextras","private":false,"owner":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras","description":null,"fork":false,"url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras","forks_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/forks","keys_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/teams","hooks_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/hooks","issue_events_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/events{/number}","events_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/events","assignees_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/assignees{/user}","branches_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/branches{/branch}","tags_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/tags","blobs_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/refs{/sha}","trees_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/statuses/{sha}","languages_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/languages","stargazers_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/stargazers","contributors_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/contributors","subscribers_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/subscribers","subscription_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/subscription","commits_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/commits{/sha}","git_commits_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/commits{/sha}","comments_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/comments{/number}","issue_comment_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/comments{/number}","contents_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/contents/{+path}","compare_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/merges","archive_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/downloads","issues_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues{/number}","pulls_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls{/number}","milestones_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/milestones{/number}","notifications_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/labels{/name}","releases_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/releases{/id}","deployments_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/deployments","created_at":"2018-01-30T13:57:44Z","updated_at":"2018-12-14T13:24:53Z","pushed_at":"2018-12-18T18:14:00Z","git_url":"git://github.com/compucorp/uk.co.compucorp.membershipextras.git","ssh_url":"git@github.com:compucorp/uk.co.compucorp.membershipextras.git","clone_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras.git","svn_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras","homepage":null,"size":505,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"compucorp:workstream-BASW-320-pp-phase-4","ref":"workstream-BASW-320-pp-phase-4","sha":"e6baea14a97bf9987a8612a0699f297a4ce10dbb","user":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"repo":{"id":119543283,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk1NDMyODM=","name":"uk.co.compucorp.membershipextras","full_name":"compucorp/uk.co.compucorp.membershipextras","private":false,"owner":{"login":"compucorp","id":2040164,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDAxNjQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2040164?v=4","gravatar_id":"","url":"https://api.github.com/users/compucorp","html_url":"https://github.com/compucorp","followers_url":"https://api.github.com/users/compucorp/followers","following_url":"https://api.github.com/users/compucorp/following{/other_user}","gists_url":"https://api.github.com/users/compucorp/gists{/gist_id}","starred_url":"https://api.github.com/users/compucorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compucorp/subscriptions","organizations_url":"https://api.github.com/users/compucorp/orgs","repos_url":"https://api.github.com/users/compucorp/repos","events_url":"https://api.github.com/users/compucorp/events{/privacy}","received_events_url":"https://api.github.com/users/compucorp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras","description":null,"fork":false,"url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras","forks_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/forks","keys_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/teams","hooks_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/hooks","issue_events_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/events{/number}","events_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/events","assignees_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/assignees{/user}","branches_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/branches{/branch}","tags_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/tags","blobs_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/refs{/sha}","trees_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/statuses/{sha}","languages_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/languages","stargazers_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/stargazers","contributors_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/contributors","subscribers_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/subscribers","subscription_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/subscription","commits_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/commits{/sha}","git_commits_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/git/commits{/sha}","comments_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/comments{/number}","issue_comment_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/comments{/number}","contents_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/contents/{+path}","compare_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/merges","archive_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/downloads","issues_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues{/number}","pulls_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls{/number}","milestones_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/milestones{/number}","notifications_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/labels{/name}","releases_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/releases{/id}","deployments_url":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/deployments","created_at":"2018-01-30T13:57:44Z","updated_at":"2018-12-14T13:24:53Z","pushed_at":"2018-12-18T18:14:00Z","git_url":"git://github.com/compucorp/uk.co.compucorp.membershipextras.git","ssh_url":"git@github.com:compucorp/uk.co.compucorp.membershipextras.git","clone_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras.git","svn_url":"https://github.com/compucorp/uk.co.compucorp.membershipextras","homepage":null,"size":505,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118"},"html":{"href":"https://github.com/compucorp/uk.co.compucorp.membershipextras/pull/118"},"issue":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/118"},"comments":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/compucorp/uk.co.compucorp.membershipextras/statuses/d0d26de987a27d9e901531d74f5fde72f2b915dc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"omarabuhussein"}}