Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
I got error: Expected argument of type \"null\", \"Symfony\\Component…#6007
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…\\HttpFoundation\\Request\" givenhttps://github.com/symfony/form/blob/master/NativeRequestHandler.php#L55 "class": "'Symfony\\Component\\Form\\Exception\\UnexpectedTypeException'", "file": "'\/home\/www\/datravel\/datravel-website\/vendor\/symfony\/form\/NativeRequestHandler.php'", "line": "56", "level": 500, "level_name": "CRITICAL",#0 /vendor/symfony/form/Form.php(499): Symfony\Component\Form\NativeRequestHandler->handleRequest(Object(Symfony\Component\Form\Form), Object(Symfony\Component\HttpFoundation\Request))#1 /application/controllers/product.php(335): Symfony\Component\Form\Form->handleRequest(Object(Symfony\Component\HttpFoundation\Request))
@@ -556,7 +556,7 @@ method: | |||
$request = Request::createFromGlobals(); | |||
$form->handleRequest($request); | |||
$form->handleRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As aRequest
instance is created in this example, I guess the fix should be to add theHttpFoundation
integration before those lines and revert this change:
useSymfony\Component\Form\Forms;useSymfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;$formFactory = Forms::createFormFactoryBuilder() ->addExtension(newHttpFoundationExtension()) ->getFormFactory();
This will add theHttpFoundationRequestHandler
, instead of using the baseNativeRequestHandler
.
@yapro : I think there is a misunderstanding. |
Thx, I use the form component as standalone. |
I got error: 'Expected argument of type "null", "Symfony\Component\HttpFoundation\Request" given'
https://github.com/symfony/form/blob/master/NativeRequestHandler.php#L55
#0 /vendor/symfony/form/Form.php(499): Symfony\Component\Form\NativeRequestHandler->handleRequest(Object(Symfony\Component\Form\Form), Object(Symfony\Component\HttpFoundation\Request))
#1 /application/controllers/product.php(335): Symfony\Component\Form\Form->handleRequest(Object(Symfony\Component\HttpFoundation\Request))