diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f8cae41b..c13809729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ * Fixed an error when trying to delete a file from non-existing Flex Object * Fixed `FlexObject::exists()` failing sometimes just after the object has been saved * Fixed CSV formatter not encoding strings with `"` and `,` properly + * Fixed var order in `Validation.php` [#2610](https://github.com/getgrav/grav/issues/2610) # v1.6.11 ## 06/21/2019 diff --git a/system/src/Grav/Common/Data/Validation.php b/system/src/Grav/Common/Data/Validation.php index b1c4cd373..7779b1c27 100644 --- a/system/src/Grav/Common/Data/Validation.php +++ b/system/src/Grav/Common/Data/Validation.php @@ -27,8 +27,9 @@ class Validation if (!isset($field['type'])) { $field['type'] = 'text'; } - $type = $validate['type'] ?? $field['type']; + $validate = (array)($field['validate'] ?? null); + $type = $validate['type'] ?? $field['type']; $required = $validate['required'] ?? false; // If value isn't required, we will stop validation if empty value is given.