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());