-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Regression when ArgumentResolver::getArguments() passes an empty array of reflectors to ArgumentMetadataFactory::createArgumentMetadata() #47461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the patch. Can you please add a test case to prevent any regressions? |
The issue might be unrelated to calling ReflectionFunction vs ReflectionMethod. |
Given #46001 is only in Symfony 6.2, if it was me, I would revert that, and then add it back with a fix + test for this regression. fwiw the call to ArgumentResolver::getArguments() that's failing is in Drupal\Core\Controller\TitleResolver::getTitle()(https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Controller%21TitleResolver.php/function/TitleResolver%3A%3AgetTitle/10.0.x) |
Took a closer look. The issue might be that Symfony/Component/HttpKernel/Controller/ArgumentResolver::getArguments() passes an empty array of reflectors instead of NULL? Have updated the PR with this change. |
I'd be happy to have a look. Can you please let me know how I can reproduce the issue after getting a fresh clone of drupal? |
So...
Unfortunately can't yet find a concise Drupal core test that triggers this bug - lots of Functional tests fail, but unit tests are mocking ArgumentResolver and not triggering the bug. Doesn't mean there isn't one, but haven't found it yet |
Thanks for the details, for giving it a try, and for the reproducer! |
Oh nice one thanks for taking a proper look! |
… request (nicolas-grekas) This PR was merged into the 6.2 branch. Discussion ---------- [HttpKernel] Don't cache controller's reflector inside the request | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #47461 | License | MIT | Doc PR | - Issue introduced by #46001 Commits ------- c751bd0 [HttpKernel] Don't cache controller's reflector inside the request
We're in the progress of preparing Drupal 10 for Symfony 6.2 compatibility and found a regression caused by #46001
Drupal issue is https://www.drupal.org/project/drupal/issues/3284422 (no dedicated issue for this yet)
Easiest way to see this is the original diff from that MR, i.e. https://github.com/symfony/symfony/pull/46001/files#diff-d3747dd395ddb12ee6fd6bdd911faa1cab4e10cfa69489918bf443fc2d25ba2fL28
Restoring the specific handling for $controller as array seems to be enough to fix things on our end, although maybe the call to ReflectionFunction can be changed to handle it too. Just trying to get this up quickly for discussion.
The symptom of this is that the arguments don't get passed to the controller, which is fatal errors everywhere.