Browse Source

Update Core\Validator for new Fork\__() function

Now an error array contains untranslated strings or template arrays.
Translation must be made in the output template iswev.
Visman 4 years ago
parent
commit
be429ea4c3
1 changed files with 5 additions and 4 deletions
  1. 5 4
      app/Core/Validator.php

+ 5 - 4
app/Core/Validator.php

@@ -371,7 +371,7 @@ class Validator
             list($type, $error) = $error;
         }
 
-        $this->errors[$type][] = __([$error, [':alias' => __($alias), ':attr' => $attr]]);
+        $this->errors[$type][] = [$error, [':alias' => __($alias), ':attr' => $attr]];
         $this->error           = true;
     }
 
@@ -440,9 +440,10 @@ class Validator
     public function getErrorsWithoutType(): array
     {
         $result = [];
-        \array_walk_recursive($this->errors, function ($item) use (&$result) {
-            $result[] = $item;
-        });
+
+        foreach ($this->errors as $errors) {
+            \array_push($result, ...$errors);
+        }
 
         return $result;
     }