From cfc8e5b428b693af0245997575db1231ee7ad48b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 26 Mar 2021 19:11:54 -0700 Subject: [PATCH] Flexmailer - Switch defintion of "auto" to "flexmailer" --- ext/flexmailer/settings/flexmailer.setting.php | 2 +- ext/flexmailer/src/Listener/Abdicator.php | 7 +------ tests/phpunit/CRM/Mailing/MailingSystemTest.php | 4 +++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ext/flexmailer/settings/flexmailer.setting.php b/ext/flexmailer/settings/flexmailer.setting.php index 6b51460e6b..ea227d9ef0 100644 --- a/ext/flexmailer/settings/flexmailer.setting.php +++ b/ext/flexmailer/settings/flexmailer.setting.php @@ -11,7 +11,7 @@ return [ 'html_type' => 'select', 'html_attributes' => ['class' => 'crm-select2'], 'pseudoconstant' => ['callback' => '_flexmailer_traditional_options'], - 'default' => 'flexmailer', + 'default' => 'auto', 'add' => '5.13', 'title' => E::ts('Traditional Mailing Handler'), 'is_domain' => 1, diff --git a/ext/flexmailer/src/Listener/Abdicator.php b/ext/flexmailer/src/Listener/Abdicator.php index 5ec0077209..b237d5899e 100644 --- a/ext/flexmailer/src/Listener/Abdicator.php +++ b/ext/flexmailer/src/Listener/Abdicator.php @@ -40,15 +40,10 @@ class Abdicator { } switch (\Civi::settings()->get('flexmailer_traditional')) { - case 'auto': - // Transitional support for old hidden setting "experimentalFlexMailerEngine" (bool) - // TODO: Remove this. Maybe after Q4 2019. - // TODO: Change this to default to flexmailer - return (bool) \Civi::settings()->get('experimentalFlexMailerEngine'); - case 'bao': return FALSE; + case 'auto': case 'flexmailer': return TRUE; diff --git a/tests/phpunit/CRM/Mailing/MailingSystemTest.php b/tests/phpunit/CRM/Mailing/MailingSystemTest.php index b1846cee7e..80e7938e69 100644 --- a/tests/phpunit/CRM/Mailing/MailingSystemTest.php +++ b/tests/phpunit/CRM/Mailing/MailingSystemTest.php @@ -40,7 +40,9 @@ class CRM_Mailing_MailingSystemTest extends CRM_Mailing_BaseMailingSystemTest { public function setUp() { parent::setUp(); - Civi::settings()->add(['experimentalFlexMailerEngine' => FALSE]); + // If we happen to execute with flexmailer active, use BAO mode. + // There is a parallel FlexMailerSystemTest which runs in flexmailer mode. + Civi::settings()->add(['flexmailer_traditional' => 'bao']); $hooks = \CRM_Utils_Hook::singleton(); $hooks->setHook('civicrm_alterMailParams', -- 2.25.1