Commit 8b5cd56
committed
bug #53418 [FrameworkBundle][Notifier] Fix service registration (MessageBird + TurboSms) (smnandre)
This PR was merged into the 5.4 branch.
Discussion
----------
[FrameworkBundle][Notifier] Fix service registration (MessageBird + TurboSms)
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix #
| License | MIT
Inside the [registerNotifierConfiguration](https://github.com/symfony/symfony/blob/9069d14de61d6d54ba62a6b611430dd5f9cadc78/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L2486) method, the [$classToServices](https://github.com/symfony/symfony/blob/9069d14de61d6d54ba62a6b611430dd5f9cadc78/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L2537) map (TransportFactoryClass => serviceId) used the Transport class (instead of the TransportFactory) for MessageBird and TurboSms.
The services are registered in [Ressources/config/notifier_transports.php](https://github.com/symfony/symfony/blob/9069d14de61d6d54ba62a6b611430dd5f9cadc78/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_transports.php#L261) (with the correct Factory classes).
This map is then used in this loop:
```php
foreach ($classToServices as $class => $service) {
$package = substr($service, \strlen('notifier.transport_factory.'));
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-notifier', $package), $class, $parentPackages, true)) {
$container->removeDefinition($service);
$container->removeAlias(str_replace('-', '', $service)); // `@deprecated` to be removed in 6.0
}
}
```
So i'm not sure it's considered a bug as IRL checking the Factory class or the Transport class did not make any difference as i read it.... but it's worth a fix for the future :)
So i target 5.4 with no certitude :)
Commits
-------
3e535b42aa [Notifier] Fix FrameworkExtension factory classes (MessageBird & TurboSms)1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
2555 | 2555 | | |
2556 | 2556 | | |
2557 | 2557 | | |
2558 | | - | |
| 2558 | + | |
2559 | 2559 | | |
2560 | 2560 | | |
2561 | 2561 | | |
| |||
2574 | 2574 | | |
2575 | 2575 | | |
2576 | 2576 | | |
2577 | | - | |
| 2577 | + | |
2578 | 2578 | | |
2579 | 2579 | | |
2580 | 2580 | | |
| |||
0 commit comments