From 5c708af2725b80b9b12bdd689f4a1cda66191759 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 13 Mar 2022 14:19:56 +0000 Subject: [PATCH] [CORE][Form] Remove unweildy return of form errors from Form::handle --- src/Core/Form.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Core/Form.php b/src/Core/Form.php index a1eaa877b2..9002ad1e20 100644 --- a/src/Core/Form.php +++ b/src/Core/Form.php @@ -163,15 +163,7 @@ abstract class Form $form->handleRequest($request); if ($request->getMethod() === 'POST' && $form->isSubmitted()) { - if (!$form->isValid()) { - $errors = []; - foreach ($form->all() as $child) { - if (!$child->isValid()) { - $errors[$child->getName()] = (string) $form[$child->getName()]->getErrors(); - } - } - return $errors; - } else { + if ($form->isValid()) { $data = $form->getData(); if (\is_null($target)) { return $data;