diff --git a/src/Controller/Admin/BlogController.php b/src/Controller/Admin/BlogController.php index 819e04e65..b40984a07 100644 --- a/src/Controller/Admin/BlogController.php +++ b/src/Controller/Admin/BlogController.php @@ -86,9 +86,8 @@ public function new( $form->handleRequest($request); - // the isSubmitted() method is completely optional because the other - // isValid() method already checks whether the form is submitted. - // However, we explicitly add it to improve code readability. + // The isSubmitted() call is mandatory because the isValid() method + // throws an exception if the form has not been submitted. // See https://symfony.com/doc/current/forms.html#processing-forms if ($form->isSubmitted() && $form->isValid()) { $entityManager->persist($post);