You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait throws Critical Error instead of throwing the right Exception with helpfull Message.
The Error thrown is "Call to undefined function Symfony\Bundle\SecurityBundle\LoginLink\LoginLinkHandler()".
The right Error message, I assume, would be "Cannot determine the correct Symfony\Bundle\SecurityBundle\LoginLink\LoginLinkHandler to use: there is no active Request and so, the firewall cannot be determined. Try using a specific Symfony\Bundle\SecurityBundle\LoginLink\Logi
nLinkHandler service."
How to reproduce
Create new Symfony project with php 7.4 symfony new my_project_name --full
Create new Command, inject LoginLinkHandlerInterface and try to call $this->loginLinkHandler->createLoginLink($user);
Execute Command and take a look at the Error message.
Possible Solution
Change Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait line to throw new \LogicException('Cannot determine the correct '.$serviceIdentifier.' to use: there is no active Request and so, the firewall cannot be determined. Try using a specific '.$serviceIdentifier.' service.');
Additional context
The text was updated successfully, but these errors were encountered:
…wareTrait (fkropfhamer)
This PR was submitted for the 5.4 branch but it was squashed and merged into the 5.3 branch instead.
Discussion
----------
[SecurityBundle] Fixed LogicException message of FirewallAwareTrait
| Q | A
| ------------- | ---
| Branch? | 5.4 for features / 4.4 or 5.3 for bug fixes <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#43145 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against branch 5.x.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
Commits
-------
d93da59 [SecurityBundle] Fixed LogicException message of FirewallAwareTrait
Symfony version(s) affected: 5.3.7
Description
The Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait throws Critical Error instead of throwing the right Exception with helpfull Message.
The Error thrown is "Call to undefined function Symfony\Bundle\SecurityBundle\LoginLink\LoginLinkHandler()".
The right Error message, I assume, would be "Cannot determine the correct Symfony\Bundle\SecurityBundle\LoginLink\LoginLinkHandler to use: there is no active Request and so, the firewall cannot be determined. Try using a specific Symfony\Bundle\SecurityBundle\LoginLink\Logi
nLinkHandler service."
How to reproduce
symfony new my_project_name --full
$this->loginLinkHandler->createLoginLink($user);
Possible Solution
Change Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait line to
throw new \LogicException('Cannot determine the correct '.$serviceIdentifier.' to use: there is no active Request and so, the firewall cannot be determined. Try using a specific '.$serviceIdentifier.' service.');
Additional context
The text was updated successfully, but these errors were encountered: