From: Eileen McNaughton Date: Fri, 22 Sep 2023 21:43:36 +0000 (+1200) Subject: Fix undefined property on fromEmails for Participant fee X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b0328141c18fb63d71cc9ce2ae93915c5e214568;p=civicrm-core.git Fix undefined property on fromEmails for Participant fee --- diff --git a/CRM/Event/Form/EventFees.php b/CRM/Event/Form/EventFees.php index 5ef84b3c58..4755e31e7c 100644 --- a/CRM/Event/Form/EventFees.php +++ b/CRM/Event/Form/EventFees.php @@ -37,9 +37,6 @@ class CRM_Event_Form_EventFees { $form->_pId = CRM_Utils_Request::retrieve('participantId', 'Positive', $form); $form->_discountId = CRM_Utils_Request::retrieve('discountId', 'Positive', $form); - // @todo - stop setting this, call the function, as appropriate. This is in a weird place. - $form->_fromEmails = CRM_Event_BAO_Event::getFromEmailIds($form->_eventId); - //CRM-6907 set event specific currency. if ($form->_eventId && ($currency = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'currency')) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index b066d7edd2..7cc8ccfb28 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -2147,6 +2147,8 @@ INNER JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field_ } } $this->assign('customGroup', $customGroup); + + $fromEmails = CRM_Event_BAO_Event::getFromEmailIds($this->getEventID()); foreach ($this->_contactIds as $num => $contactID) { // Retrieve the name and email of the contact - this will be the TO for receipt email [, $this->_contributorEmail, $this->_toDoNotEmail] = CRM_Contact_BAO_Contact::getContactDetails($contactID); @@ -2235,8 +2237,8 @@ INNER JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field_ $sendTemplateParams['from'] = $params['from_email_address']; $sendTemplateParams['toName'] = $this->getContactValue('display_name'); $sendTemplateParams['toEmail'] = $this->_contributorEmail; - $sendTemplateParams['cc'] = $this->_fromEmails['cc'] ?? NULL; - $sendTemplateParams['bcc'] = $this->_fromEmails['bcc'] ?? NULL; + $sendTemplateParams['cc'] = $fromEmails['cc'] ?? NULL; + $sendTemplateParams['bcc'] = $fromEmails['bcc'] ?? NULL; } //send email with pdf invoice