Prevent default texter configuration if already defined

Check existing framework configurations for `texter_transports` before applying default settings. This avoids overwriting or conflicting with pre-defined notifier configurations.
This commit is contained in:
Julien Fastré 2025-01-21 22:41:39 +01:00
parent 47c0af3623
commit ceb0bd982e
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: Fix legacy configuration processor for notifier component
time: 2025-01-21T22:58:38.805800688+01:00
custom:
Issue: ""
SchemaChange: No schema change

View File

@ -366,6 +366,17 @@ class ChillMainExtension extends Extension implements
*/
private function prependNotifierTexterWithLegacyData(ContainerBuilder $container): void
{
foreach (array_reverse($container->getExtensionConfig('framework')) as $c) {
// we look into each configuration for framework. If there is a configuration for
// texter_transports in one of them, we don't configure anything else
if (null !== $notifConfig = $c['notifier'] ?? null) {
if (null !== ($notifConfig['texter_transports'] ?? null)) {
return;
}
}
}
// there is no texter config, we try to configure one
$configs = $container->getExtensionConfig('chill_main');
$notifierSet = false;
foreach (array_reverse($configs) as $config) {