// This rule somehow disappears if there's a form-related test before us,
// so register it again. See packages/HTML/QuickForm/file.php.
$form->registerRule('maxfilesize', 'callback', '_ruleCheckMaxFileSize', 'HTML_QuickForm_file');
- CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($form);
- $form->buildQuickForm();
+ $form->isSearchContext = FALSE;
+ $form->buildForm();
$form->submit(array_merge($form->_defaultValues, [
'from_email_address' => $loggedInEmail['id'],
'subject' => 'Really interesting stuff',