Skip to content
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

[PHP8.2] Remove unused variabls from Member_Form_Task_PDFLetter::postProcessMembers #25830

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions CRM/Member/Form/Task/PDFLetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ class CRM_Member_Form_Task_PDFLetter extends CRM_Member_Form_Task {
/**
* Build all the data structures needed to build the form.
*
* @return void
* @throws \CRM_Core_Exception
*/
public function preProcess() {
$this->skipOnHold = $this->skipDeceased = FALSE;
parent::preProcess();
$this->setContactIDs();
$this->preProcessPDF();
Expand All @@ -66,32 +65,28 @@ public function buildQuickForm() {
*
*
* @return void
* @throws \CRM_Core_Exception
*/
public function postProcess() {
// TODO: rewrite using contribution token and one letter by contribution
$this->setContactIDs();
$skipOnHold = $this->skipOnHold ?? FALSE;
$skipDeceased = $this->skipDeceased ?? TRUE;
$this->postProcessMembers($this->_memberIds, $skipOnHold, $skipDeceased, $this->_contactIds);
$this->postProcessMembers($this->_memberIds, $this->_contactIds);
}

/**
* Process the form after the input has been submitted and validated.
*
* @param $membershipIDs
* @param $skipOnHold
* @param $skipDeceased
* @param $contactIDs
*
* @throws \CRM_Core_Exception
* @todo this is horrible copy & paste code because there is so much risk of breakage
* in fixing the existing pdfLetter classes to be suitably generic
*
*/
public function postProcessMembers($membershipIDs, $skipOnHold, $skipDeceased, $contactIDs) {
public function postProcessMembers($membershipIDs, $contactIDs) {
$form = $this;
$formValues = $form->controller->exportValues($form->getName());
[$formValues, $html_message, $messageToken, $returnProperties] = $this->processMessageTemplate($formValues);
[$formValues, $html_message, $messageToken] = $this->processMessageTemplate($formValues);

$html
= $this->generateHTML(
Expand Down