From 2259d8c8ef0a167b1222a189c42869630bfeae74 Mon Sep 17 00:00:00 2001 From: victor Date: Tue, 21 Apr 2015 11:35:42 +0300 Subject: [PATCH] Remove unnecessary call of isSubmitted method on forms --- 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 f1e5e0c33..3b3b03768 100644 --- a/src/AppBundle/Controller/Admin/BlogController.php +++ b/src/AppBundle/Controller/Admin/BlogController.php @@ -70,7 +70,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(); @@ -122,7 +122,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 15351a957..55c62a91b 100644 --- a/src/AppBundle/Controller/BlogController.php +++ b/src/AppBundle/Controller/BlogController.php @@ -73,7 +73,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());