{"action":"created","issue":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11985","repository_url":"https://api.github.com/repos/civicrm/civicrm-core","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11985/labels{/name}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11985/comments","events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11985/events","html_url":"https://github.com/civicrm/civicrm-core/pull/11985","id":314928657,"number":11985,"title":"dev/core#48 Fix PDF Letter only generates a single letter when multiple contact IDs are specified","user":{"login":"monishdeb","id":3735621,"avatar_url":"https://avatars3.githubusercontent.com/u/3735621?v=4","gravatar_id":"","url":"https://api.github.com/users/monishdeb","html_url":"https://github.com/monishdeb","followers_url":"https://api.github.com/users/monishdeb/followers","following_url":"https://api.github.com/users/monishdeb/following{/other_user}","gists_url":"https://api.github.com/users/monishdeb/gists{/gist_id}","starred_url":"https://api.github.com/users/monishdeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monishdeb/subscriptions","organizations_url":"https://api.github.com/users/monishdeb/orgs","repos_url":"https://api.github.com/users/monishdeb/repos","events_url":"https://api.github.com/users/monishdeb/events{/privacy}","received_events_url":"https://api.github.com/users/monishdeb/received_events","type":"User","site_admin":false},"labels":[{"id":246037889,"url":"https://api.github.com/repos/civicrm/civicrm-core/labels/master","name":"master","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-17T06:56:32Z","updated_at":"2018-04-17T07:08:21Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/11985","html_url":"https://github.com/civicrm/civicrm-core/pull/11985","diff_url":"https://github.com/civicrm/civicrm-core/pull/11985.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/11985.patch"},"body":"Overview\r\n----------------------------------------\r\nRef https://lab.civicrm.org/dev/core/issues/48\r\nWhen multiple contact IDs are specified via print/merge task the PDFLetterCommon code overwrites them with a single contact ID of the logged in user.  This means that only a single PDF letter is printed/generated.\r\nThis PR only uses the logged in contact ID if not contact IDs have been specified.\r\n\r\nBefore\r\n----------------------------------------\r\nOnly a single PDF letter was being generated by print/merge document.\r\n\r\nAfter\r\n----------------------------------------\r\nMultiple PDF letters are generated by print/merge document.\r\n\r\nComments\r\n----------------------------------------\r\nIt is possible that this issue was introduced by changes in #11411 which introduced a CRM_Core_Form_Task class but looking at the code and the proposed changes here I'm not sure how Print/Merge ever printed multiple documents as the code I'm changing here hasn't changed for more than 5 years!\r\n"},"comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments/381872310","html_url":"https://github.com/civicrm/civicrm-core/pull/11985#issuecomment-381872310","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/11985","id":381872310,"user":{"login":"eileenmcnaughton","id":336308,"avatar_url":"https://avatars2.githubusercontent.com/u/336308?v=4","gravatar_id":"","url":"https://api.github.com/users/eileenmcnaughton","html_url":"https://github.com/eileenmcnaughton","followers_url":"https://api.github.com/users/eileenmcnaughton/followers","following_url":"https://api.github.com/users/eileenmcnaughton/following{/other_user}","gists_url":"https://api.github.com/users/eileenmcnaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/eileenmcnaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eileenmcnaughton/subscriptions","organizations_url":"https://api.github.com/users/eileenmcnaughton/orgs","repos_url":"https://api.github.com/users/eileenmcnaughton/repos","events_url":"https://api.github.com/users/eileenmcnaughton/events{/privacy}","received_events_url":"https://api.github.com/users/eileenmcnaughton/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T07:08:21Z","updated_at":"2018-04-17T07:08:21Z","author_association":"CONTRIBUTOR","body":"@monishdeb on checking there is quite a bit of order-variance on the other classes - this seems like the one you are emulating\r\n\r\n```\r\n  /**\r\n   * Build all the data structures needed to build the form.\r\n   */\r\n  public function preProcess() {\r\n    CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);\r\n    parent::preProcess();\r\n\r\n    // we have all the participant ids, so now we get the contact ids\r\n    parent::setContactIDs();\r\n\r\n    $this->assign('single', $this->_single);\r\n  }\r\n```\r\n\r\nI can't see anything in the parent::preProcess that will be hurt by moving it right up there before it.\r\n\r\nMerging"}}
{"actor":{"display_login":"eileenmcnaughton"}}