From f2c2debb28be73cfb4854e19dce8b67db236ac7a Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Fri, 13 Nov 2015 17:50:04 +0100 Subject: [PATCH] Fix exception message when label is not set --- system/src/Grav/Common/Data/Blueprint.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php index 97ed5858a..bf1f5a32f 100644 --- a/system/src/Grav/Common/Data/Blueprint.php +++ b/system/src/Grav/Common/Data/Blueprint.php @@ -450,7 +450,8 @@ class Blueprint if (isset($field['validate']['required']) && $field['validate']['required'] === true && empty($data[$name])) { - throw new \RuntimeException("Missing required field: {$field['label']}"); + $value = isset($field['label']) ? $field['label'] : $field['name']; + throw new \RuntimeException("Missing required field: {$value}"); } } }