From fb05976fa681610e8e855ec42eedbb3a00e492b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 28 Aug 2016 11:08:32 +0200 Subject: [PATCH] [core] fix two-levels list default value support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- lib/Bridge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Bridge.php b/lib/Bridge.php index fc09b63..7ee4fc7 100644 --- a/lib/Bridge.php +++ b/lib/Bridge.php @@ -319,7 +319,11 @@ abstract class BridgeAbstract implements BridgeInterface { break; case 'list': if(!isset($properties['defaultValue'])){ - $this->inputs[$context][$name]['value']=reset($properties['values']); + $firstItem=reset($properties['values']); + if(is_array($firstItem)){ + $firstItem=reset($firstItem); + } + $this->inputs[$context][$name]['value']=$firstItem; }else{ $this->inputs[$context][$name]['value']=$properties['defaultValue']; }