Exceptions
Exception
Symfony\Component\Form\Exception\ LogicException
in
vendor/symfony/form/Form.php
(line 765)
* {@inheritdoc}
*/
public function isValid()
{
if (!$this->submitted) {
throw new LogicException('Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() before Form::isValid().');
}
if ($this->isDisabled()) {
return true;
}
$formType = $this->getSyliusAttribute($request, 'form', ContactType::class);
$form = $this->formFactory->create($formType, null, $this->getFormOptions());
//$form = $this->createForm(ContactType::class);
if ($request->isMethod('POST') && $form->handleRequest($request)->isValid()) {
$data = $form->getData();
/** @var ChannelInterface $channel */
$channel = $this->channelContext->getChannel();
Assert::isInstanceOf($channel, ChannelInterface::class);
in
vendor/symfony/http-kernel/HttpKernel.php
->
requestAction
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Logs
No log messages
Stack Trace
LogicException
|
---|
Symfony\Component\Form\Exception\LogicException: Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() before Form::isValid(). at vendor/symfony/form/Form.php:765 at Symfony\Component\Form\Form->isValid() (src/Controller/ContactController.php:95) at App\Controller\ContactController->requestAction() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:25) |