-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit 2a98bba
committed
bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
This PR was squashed before being merged into the 3.4 branch (closes #25100).
Discussion
----------
[SecurityBundle] providerIds is undefined error when firewall provider is not specified
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
If I don't specify user provider on a firewall, it throws an error: `Undefined variable: providerIds`. That's because of $providerIds in [3.4-RC1](https://github.com/symfony/symfony/blob/v3.4.0-RC1/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L696) that is not defined.
```
private function createSwitchUserListener($container, $id, $config, $defaultProvider, $stateless)
{
$userProvider = isset($config['provider']) ? $this->getUserProviderId($config['provider']) : ($defaultProvider ?: $this->getFirstProvider($id, 'switch_user', $providerIds));
```
In fact, in [master](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L599) it's fixed
If I add a provider to the firewall, this error doesn't reproduce:
```
secured_area:
switch_user: true
provider: chain_provider
```
Commits
-------
aedf897 [SecurityBundle] providerIds is undefined error when firewall provider is not specifiedFile tree
0 file changed
+0
-0
lines changedFilter options
0 file changed
+0
-0
lines changed
0 commit comments