mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Fixup form submission.
In our case, we want to allow empty requests... If using handleRequest, the form should at least contains the CSRF tokens.
This commit is contained in:
@@ -22,17 +22,20 @@ class SetupController extends Controller
|
||||
$manipulator = $this->app['registry.manipulator'];
|
||||
$form = $manipulator->createForm($this->app['conf']);
|
||||
|
||||
$status = 200;
|
||||
if ('POST' === $request->getMethod()) {
|
||||
$form->handleRequest($request);
|
||||
$form->submit($request->request->all());
|
||||
if ($form->isValid()) {
|
||||
$this->app['conf']->set('registry', $manipulator->getRegistryData($form));
|
||||
|
||||
return $this->app->redirectPath('setup_display_globals');
|
||||
}
|
||||
|
||||
$status = 400;
|
||||
}
|
||||
|
||||
return $this->render('admin/setup.html.twig', [
|
||||
return $this->renderResponse('admin/setup.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
], $status);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user