From f4b90755f2a79841df888a204ac9bfec56d418ba Mon Sep 17 00:00:00 2001 From: Niklas Rother Date: Fri, 17 Feb 2017 16:52:51 +0100 Subject: [PATCH] Return specified default value in EntityContext With the current implementation the default value is ignored when the EntityContext was created from an array. --- src/View/Form/EntityContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/View/Form/EntityContext.php b/src/View/Form/EntityContext.php index 4e1919f21ca..3530adccccd 100644 --- a/src/View/Form/EntityContext.php +++ b/src/View/Form/EntityContext.php @@ -262,7 +262,7 @@ public function val($field, $options = []) if (is_array($entity)) { $key = array_pop($parts); - return isset($entity[$key]) ? $entity[$key] : null; + return isset($entity[$key]) ? $entity[$key] : $options['default']; } return null;