Skip to content

Commit

Permalink
bug #44016 [SecurityBundle] Fix listing listeners in profiler when au…
Browse files Browse the repository at this point in the history
…thenticator manager is disabled (94noni)

This PR was merged into the 5.4 branch.

Discussion
----------

[SecurityBundle] Fix listing listeners in profiler when authenticator manager is disabled

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix profiler v5.4.0.beta1
| License       | MIT

I am trying to upgrade an app from v4.4 to v5.4 beta1
when going to the profiler > security panel, I got this error:
`Neither the property "listeners" nor one of the methods "listeners()", "getlisteners()"/"islisteners()"/"haslisteners()" or "__call()" exist and have public access in class "Symfony\Component\VarDumper\Cloner\Data".`

This PR tries to fix this in Twig, I do not know the collector logic to fix differently

Commits
-------

f27091a [SecurityBundle] Fix listing listeners in profiler when authenticator manager is disabled
  • Loading branch information
fabpot committed Nov 12, 2021
2 parents 3ff378a + f27091a commit 9211bcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -194,9 +194,15 @@ public function collect(Request $request, Response $response, \Throwable $except
'access_denied_handler' => $firewallConfig->getAccessDeniedHandler(),
'access_denied_url' => $firewallConfig->getAccessDeniedUrl(),
'user_checker' => $firewallConfig->getUserChecker(),
'authenticators' => $firewallConfig->getAuthenticators(),
];

// in 6.0, always fill `$this->data['authenticators'] only
if ($this->authenticatorManagerEnabled) {
$this->data['authenticators'] = $firewallConfig->getAuthenticators();
} else {
$this->data['listeners'] = $firewallConfig->getAuthenticators();
}

// generate exit impersonation path from current request
if ($this->data['impersonated'] && null !== $switchUserConfig = $firewallConfig->getSwitchUser()) {
$exitPath = $request->getRequestUri();
Expand Down
Expand Up @@ -113,7 +113,7 @@ public function getAccessDeniedUrl(): ?string
}

/**
* @deprecated since Symfony 5.4, use {@see getListeners()} instead
* @deprecated since Symfony 5.4, use {@see getAuthenticators()} instead
*/
public function getListeners(): array
{
Expand Down

0 comments on commit 9211bcc

Please sign in to comment.