Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Open
Description
Symfony version(s) affected
7.2.4
Description
regression caused by#59728
Symfony\Component\Security\Csrf\CsrfTokenManager::getToken(): Argument#1 ($tokenId) must be of type string, null given, called in /app/vendor/symfony/form/Extension/Csrf/Type/FormTypeCsrfExtension.php on line 80
Seems passing any array to thesetAttributes
causes this unless you passcsrf_token_id
value in that array, there is no sane default applied.
In my case I was passing other attributes in this array, but not the csrf_token_id, as that was not needed before today.
How to reproduce
Minimum reproducer is
$this->createFormBuilder()->setAttributes([/* blank array, or some other key pairs, not including csrf_token_id*/])->getForm()->createView();
Possible Solution
No response
Additional Context
related changehttps://github.com/symfony/symfony/pull/59728/files#diff-438ae1976074de3d600070f2d02f4e87bcbc847d7826ca8aaeadc4231c5d701f