From 6e90f69d8ec9994238ba026f04466eee31e43313 Mon Sep 17 00:00:00 2001 From: davidhirtz Date: Mon, 11 Mar 2024 09:53:11 +0100 Subject: [PATCH] Version 2.2.4 --- CHANGELOG.md | 2 +- src/base/traits/ApplicationTrait.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36fdd164..ce913478 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.2.4 (under development) +## 2.2.4 (Mar 11, 2024) - Added mailer transport DSN fallback (Issues #24) - Added support for `color` type input fields (Issue #22) diff --git a/src/base/traits/ApplicationTrait.php b/src/base/traits/ApplicationTrait.php index 0b42521f..325f3b68 100644 --- a/src/base/traits/ApplicationTrait.php +++ b/src/base/traits/ApplicationTrait.php @@ -187,8 +187,11 @@ protected function preInitInternal(&$config): void $config['components']['db'] = array_merge(require ($db), $config['components']['db']); } - // Mailer transport DSN might need to be set via params (eg. yii2-config module) - $config['components']['mailer']['transport']['dsn'] ??= $config['params']['mailerDsn'] ?? 'sendmail://default'; + // Mailer transport DSN might need to be set via params (e.g., `yii2-config` module), but only set it if + // `useFileTransport` is not active. + if (!($config['components']['mailer']['useFileTransport'] ?? false)) { + $config['components']['mailer']['transport']['dsn'] = $config['params']['mailerDsn'] ?? 'sendmail://default'; + } // Make sure the cache prefix via params is applied before application bootstrap, as a DB session might get // started which could trigger the database schema cache.