From c55750b3bcfc87f5101395cade306759aeed8ca4 Mon Sep 17 00:00:00 2001 From: Maciej Kobus Date: Wed, 10 Apr 2024 11:21:04 +0200 Subject: [PATCH] IBX-7946: [BC BREAK] Renamed main SA-aware config node from notifications to notifier (#8) For more details see https://issues.ibexa.co/browse/IBX-7946 and https://github.com/ibexa/notifications/pull/8 This commit introduces Backward Compatibility breaking change due to name collision in our configuration. See the mentioned Pull Request for more details. --- .../Parser/NotificationsConfigParser.php | 12 +++++++++--- src/bundle/Resources/config/prepend.yaml | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php b/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php index a5583c0..6ade1dd 100644 --- a/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php +++ b/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php @@ -18,8 +18,14 @@ final class NotificationsConfigParser extends AbstractParser public function addSemanticConfig(NodeBuilder $nodeBuilder): void { + /* + * Node name has been changed from "notifications" to "notifier" due to + * collision with Admin UI notifications parser. + * + * TODO: Change the name back to "notifications" in the next major version. + */ $nodeBuilder - ->arrayNode('notifications') + ->arrayNode('notifier') ->children() ->arrayNode('subscriptions') ->info('Mandatory system notifications. Users cannot opt-out from below subscriptions.') @@ -42,11 +48,11 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder): void */ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer): void { - if (empty($scopeSettings['notifications'])) { + if (empty($scopeSettings['notifier'])) { return; } - $settings = $scopeSettings['notifications']; + $settings = $scopeSettings['notifier']; foreach (self::MAPPED_SETTINGS as $key) { if (!isset($settings[$key])) { diff --git a/src/bundle/Resources/config/prepend.yaml b/src/bundle/Resources/config/prepend.yaml index 2103563..b4bda60 100644 --- a/src/bundle/Resources/config/prepend.yaml +++ b/src/bundle/Resources/config/prepend.yaml @@ -3,5 +3,5 @@ ibexa: system: default: - notifications: + notifier: subscriptions: []