From 5f45a5b02b793df29c28a02821e124ae4ed9dd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 21 Sep 2020 13:38:27 +0200 Subject: [PATCH] adding #42 --- app/Menus/ItemValidator.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Menus/ItemValidator.php b/app/Menus/ItemValidator.php index 027a679..a678b27 100644 --- a/app/Menus/ItemValidator.php +++ b/app/Menus/ItemValidator.php @@ -8,7 +8,7 @@ use Respect\Validation\Exceptions\NestedValidationException; /** * * - * + * * */ class ItemValidator @@ -107,13 +107,16 @@ class ItemValidator $errors = $exception->getMessages(); } + // remove message + $this->remove($menu, $this->message); + + // if errors a set add message if (isset($errors)) { // @TODO use ColorUtil $this->message->setText("\033[33m"."\xE2\x9A\xA0 ".join(' ', $errors)); $this->addAfter($menu, $item, $this->message); - } else { - $this->remove($menu, $this->message); + } } } \ No newline at end of file