-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#48 Fix PDF Letter only generates a single letter when multiple contact IDs are specified #11985
Conversation
…le contact IDs are specified
@mattwire @eileenmcnaughton here's the additional change:
public function preProcess() {
+ CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
$this->skipOnHold = $this->skipDeceased = FALSE;
parent::preProcess();
$this->setContactIDs();
- CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
} |
@monishdeb on checking there is quite a bit of order-variance on the other classes - this seems like the one you are emulating
I can't see anything in the parent::preProcess that will be hurt by moving it right up there before it. Merging |
Yes checked these classes and they obey that pattern except the Case
|
unrelated fail |
// @TODO remove these line and to it somewhere more appropriate. Currently some classes (e.g Case | ||
// are having to re-write contactIds afterwards due to this inappropriate variable setting | ||
// If we don't have any contact IDs, use the logged in contact ID | ||
$form->_contactIds = $form->_contactIds ?: [CRM_Core_Session::getLoggedInContactID()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overview
Ref https://lab.civicrm.org/dev/core/issues/48
When 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.
This PR only uses the logged in contact ID if not contact IDs have been specified.
Before
Only a single PDF letter was being generated by print/merge document.
After
Multiple PDF letters are generated by print/merge document.
Comments
It 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!