Skip to content

Commit 2a98bba

Browse files
committed
bug symfony#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 symfony#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 specified
2 parents 3fc59a0 + aedf897 commit 2a98bba

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)