From 2bfcefc8e4cb9f2b6e83002f34ecd4abd723582f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Andrieu?= Date: Tue, 24 Mar 2015 15:36:20 +0100 Subject: [PATCH] Removed form->isSubmitted() checks --- src/AppBundle/Controller/Admin/BlogController.php | 4 ++-- src/AppBundle/Controller/BlogController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AppBundle/Controller/Admin/BlogController.php b/src/AppBundle/Controller/Admin/BlogController.php index a1a154e74..37cae70b3 100644 --- a/src/AppBundle/Controller/Admin/BlogController.php +++ b/src/AppBundle/Controller/Admin/BlogController.php @@ -64,7 +64,7 @@ public function newAction(Request $request) $form->handleRequest($request); - if ($form->isSubmitted() && $form->isValid()) { + if ($form->isValid()) { $post->setSlug($this->get('slugger')->slugify($post->getTitle())); $em = $this->getDoctrine()->getManager(); @@ -115,7 +115,7 @@ public function editAction(Post $post, Request $request) $editForm->handleRequest($request); - if ($editForm->isSubmitted() && $editForm->isValid()) { + if ($editForm->isValid()) { $post->setSlug($this->get('slugger')->slugify($post->getTitle())); $em->flush(); diff --git a/src/AppBundle/Controller/BlogController.php b/src/AppBundle/Controller/BlogController.php index 26daba304..8de6de122 100644 --- a/src/AppBundle/Controller/BlogController.php +++ b/src/AppBundle/Controller/BlogController.php @@ -67,7 +67,7 @@ public function commentNewAction(Request $request, Post $post) $form->handleRequest($request); - if ($form->isSubmitted() && $form->isValid()) { + if ($form->isValid()) { /** @var Comment $comment */ $comment = $form->getData(); $comment->setAuthorEmail($this->getUser()->getEmail());