Skip to content

Commit

Permalink
Merge pull request #16913 from eileenmcnaughton/act
Browse files Browse the repository at this point in the history
[REF] Move form specific handling back to the relevant form.
  • Loading branch information
seamuslee001 authored Mar 27, 2020
2 parents b590a8c + a1b3712 commit e735c4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 7 additions & 1 deletion CRM/Contact/Form/Task/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task {

/**
* Build all the data structures needed to build the form.
*
* @throws \CiviCRM_API3_Exception
* @throws \CRM_Core_Exception
*/
public function preProcess() {
// store case id if present
Expand Down Expand Up @@ -110,9 +113,12 @@ public function preProcess() {
else {
CRM_Utils_System::setTitle(ts('New Email'));
}
if ($this->_context === 'search') {
$this->_single = TRUE;
}
CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);

if (!$cid && $this->_context != 'standalone') {
if (!$cid && $this->_context !== 'standalone') {
parent::preProcess();
}

Expand Down
10 changes: 3 additions & 7 deletions CRM/Contact/Form/Task/EmailCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@ public static function domainEmails() {
* @throws \CiviCRM_API3_Exception
*/
public static function preProcessFromAddress(&$form, $bounce = TRUE) {
$form->_single = FALSE;
$className = CRM_Utils_System::getClassName($form);
if (property_exists($form, '_context') &&
$form->_context != 'search' &&
$className == 'CRM_Contact_Form_Task_Email'
) {
$form->_single = TRUE;
if (!isset($form->_single)) {
// @todo ensure this is already set.
$form->_single = FALSE;
}

$form->_emails = [];
Expand Down

0 comments on commit e735c4f

Please sign in to comment.