{"action":"opened","number":11904,"pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11904","id":178644863,"html_url":"https://github.com/civicrm/civicrm-core/pull/11904","diff_url":"https://github.com/civicrm/civicrm-core/pull/11904.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/11904.patch","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11904","number":11904,"state":"open","locked":false,"title":"(dev/mail/5) \"New Mailing\" - Previews should not schedule real blasts","user":{"login":"totten","id":1336047,"avatar_url":"https://avatars0.githubusercontent.com/u/1336047?v=4","gravatar_id":"","url":"https://api.github.com/users/totten","html_url":"https://github.com/totten","followers_url":"https://api.github.com/users/totten/followers","following_url":"https://api.github.com/users/totten/following{/other_user}","gists_url":"https://api.github.com/users/totten/gists{/gist_id}","starred_url":"https://api.github.com/users/totten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totten/subscriptions","organizations_url":"https://api.github.com/users/totten/orgs","repos_url":"https://api.github.com/users/totten/repos","events_url":"https://api.github.com/users/totten/events{/privacy}","received_events_url":"https://api.github.com/users/totten/received_events","type":"User","site_admin":false},"body":"Overview\r\n----------------------------------------\r\nIn `CRM_Mailing_BAO_Mailing::create` and `Mailing.create` API, there is a\r\n(*ahem*) special behavior where setting the `scheduled_date` will\r\nimmediately trigger scheduling.  One shouldn't submit `scheduled_date` for a\r\npreview.\r\n\r\nSee: https://lab.civicrm.org/dev/mail/issues/5\r\n\r\nBefore\r\n----------------------------------------\r\nIf one tentatively sets a delivery time and previews, then it prematurely schedules a MailingJob.\r\n\r\nAfter\r\n----------------------------------------\r\nIf one tentatively sets a delivery time and previews, then it does *not* prematurely schedule a MailingJob.\r\n\r\nTechnical Details\r\n----------------------------------------\r\n\r\nThis was not symptomatic before #11142/v4.7.31 because all preview\r\noperations were wrapped in a transaction and rolled back.  But now previews\r\nare allowed to have side-effects, so we need some other means to prevent.\r\n\r\nThis copies the workaround from `crmMailingMgr.save()` and applies\r\nit to `crmMailingMgr.preview()` (etal).\r\n\r\n","created_at":"2018-03-30T22:15:02Z","updated_at":"2018-03-30T22:15:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11904/commits","review_comments_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11904/comments","review_comment_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11904/comments","statuses_url":"https://api.github.com/repos/civicrm/civicrm-core/statuses/80955669a211795d6838d9ff38ca77668672b06f","head":{"label":"totten:5.0-preview-regr","ref":"5.0-preview-regr","sha":"80955669a211795d6838d9ff38ca77668672b06f","user":{"login":"totten","id":1336047,"avatar_url":"https://avatars0.githubusercontent.com/u/1336047?v=4","gravatar_id":"","url":"https://api.github.com/users/totten","html_url":"https://github.com/totten","followers_url":"https://api.github.com/users/totten/followers","following_url":"https://api.github.com/users/totten/following{/other_user}","gists_url":"https://api.github.com/users/totten/gists{/gist_id}","starred_url":"https://api.github.com/users/totten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totten/subscriptions","organizations_url":"https://api.github.com/users/totten/orgs","repos_url":"https://api.github.com/users/totten/repos","events_url":"https://api.github.com/users/totten/events{/privacy}","received_events_url":"https://api.github.com/users/totten/received_events","type":"User","site_admin":false},"repo":{"id":8498842,"name":"civicrm-core","full_name":"totten/civicrm-core","owner":{"login":"totten","id":1336047,"avatar_url":"https://avatars0.githubusercontent.com/u/1336047?v=4","gravatar_id":"","url":"https://api.github.com/users/totten","html_url":"https://github.com/totten","followers_url":"https://api.github.com/users/totten/followers","following_url":"https://api.github.com/users/totten/following{/other_user}","gists_url":"https://api.github.com/users/totten/gists{/gist_id}","starred_url":"https://api.github.com/users/totten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totten/subscriptions","organizations_url":"https://api.github.com/users/totten/orgs","repos_url":"https://api.github.com/users/totten/repos","events_url":"https://api.github.com/users/totten/events{/privacy}","received_events_url":"https://api.github.com/users/totten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/totten/civicrm-core","description":"CiviCRM (Core Application and Framework)","fork":true,"url":"https://api.github.com/repos/totten/civicrm-core","forks_url":"https://api.github.com/repos/totten/civicrm-core/forks","keys_url":"https://api.github.com/repos/totten/civicrm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/totten/civicrm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/totten/civicrm-core/teams","hooks_url":"https://api.github.com/repos/totten/civicrm-core/hooks","issue_events_url":"https://api.github.com/repos/totten/civicrm-core/issues/events{/number}","events_url":"https://api.github.com/repos/totten/civicrm-core/events","assignees_url":"https://api.github.com/repos/totten/civicrm-core/assignees{/user}","branches_url":"https://api.github.com/repos/totten/civicrm-core/branches{/branch}","tags_url":"https://api.github.com/repos/totten/civicrm-core/tags","blobs_url":"https://api.github.com/repos/totten/civicrm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/totten/civicrm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/totten/civicrm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/totten/civicrm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/totten/civicrm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/totten/civicrm-core/languages","stargazers_url":"https://api.github.com/repos/totten/civicrm-core/stargazers","contributors_url":"https://api.github.com/repos/totten/civicrm-core/contributors","subscribers_url":"https://api.github.com/repos/totten/civicrm-core/subscribers","subscription_url":"https://api.github.com/repos/totten/civicrm-core/subscription","commits_url":"https://api.github.com/repos/totten/civicrm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/totten/civicrm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/totten/civicrm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/totten/civicrm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/totten/civicrm-core/contents/{+path}","compare_url":"https://api.github.com/repos/totten/civicrm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/totten/civicrm-core/merges","archive_url":"https://api.github.com/repos/totten/civicrm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/totten/civicrm-core/downloads","issues_url":"https://api.github.com/repos/totten/civicrm-core/issues{/number}","pulls_url":"https://api.github.com/repos/totten/civicrm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/totten/civicrm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/totten/civicrm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/totten/civicrm-core/labels{/name}","releases_url":"https://api.github.com/repos/totten/civicrm-core/releases{/id}","deployments_url":"https://api.github.com/repos/totten/civicrm-core/deployments","created_at":"2013-03-01T10:09:08Z","updated_at":"2015-04-13T15:19:15Z","pushed_at":"2018-03-30T22:11:21Z","git_url":"git://github.com/totten/civicrm-core.git","ssh_url":"git@github.com:totten/civicrm-core.git","clone_url":"https://github.com/totten/civicrm-core.git","svn_url":"https://github.com/totten/civicrm-core","homepage":null,"size":158249,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"civicrm:5.0","ref":"5.0","sha":"eda4db78a8f33b74d68346079f7e7777140700df","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":8495499,"name":"civicrm-core","full_name":"civicrm/civicrm-core","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars2.githubusercontent.com/u/136373?v=4","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civicrm-core","description":"CiviCRM (Core Application and Framework)","fork":false,"url":"https://api.github.com/repos/civicrm/civicrm-core","forks_url":"https://api.github.com/repos/civicrm/civicrm-core/forks","keys_url":"https://api.github.com/repos/civicrm/civicrm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civicrm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civicrm-core/teams","hooks_url":"https://api.github.com/repos/civicrm/civicrm-core/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civicrm-core/events","assignees_url":"https://api.github.com/repos/civicrm/civicrm-core/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civicrm-core/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civicrm-core/tags","blobs_url":"https://api.github.com/repos/civicrm/civicrm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civicrm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civicrm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civicrm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civicrm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civicrm-core/languages","stargazers_url":"https://api.github.com/repos/civicrm/civicrm-core/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civicrm-core/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civicrm-core/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civicrm-core/subscription","commits_url":"https://api.github.com/repos/civicrm/civicrm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civicrm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civicrm-core/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civicrm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civicrm-core/merges","archive_url":"https://api.github.com/repos/civicrm/civicrm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civicrm-core/downloads","issues_url":"https://api.github.com/repos/civicrm/civicrm-core/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civicrm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civicrm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civicrm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civicrm-core/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civicrm-core/deployments","created_at":"2013-03-01T06:11:56Z","updated_at":"2018-03-30T00:13:32Z","pushed_at":"2018-03-30T17:48:55Z","git_url":"git://github.com/civicrm/civicrm-core.git","ssh_url":"git@github.com:civicrm/civicrm-core.git","clone_url":"https://github.com/civicrm/civicrm-core.git","svn_url":"https://github.com/civicrm/civicrm-core","homepage":null,"size":158864,"stargazers_count":262,"watchers_count":262,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":618,"mirror_url":null,"archived":false,"open_issues_count":145,"license":null,"forks":618,"open_issues":145,"watchers":262,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11904"},"html":{"href":"https://github.com/civicrm/civicrm-core/pull/11904"},"issue":{"href":"https://api.github.com/repos/civicrm/civicrm-core/issues/11904"},"comments":{"href":"https://api.github.com/repos/civicrm/civicrm-core/issues/11904/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11904/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11904/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civicrm-core/statuses/80955669a211795d6838d9ff38ca77668672b06f"}},"author_association":"OWNER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":3,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"totten"}}