From 7afd7e420bab06b1d9def44f0116ae9a1dcb24ab Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 12 Sep 2016 09:00:25 -0600 Subject: [PATCH] Better version of optgroup fix to still allow additional data (title, color) in option entries --- api/src/Etemplate/Widget/Select.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Select.php b/api/src/Etemplate/Widget/Select.php index edeb7a61de..297f3e50e7 100644 --- a/api/src/Etemplate/Widget/Select.php +++ b/api/src/Etemplate/Widget/Select.php @@ -448,7 +448,7 @@ class Select extends Etemplate\Widget { if (is_array($val)) { - if (isset($val['value']) && count($val) <= 2) + if (isset($val['value']) && count(array_filter(array_keys($val), 'is_int')) == 0) { $values[] = $val['value']; } @@ -471,7 +471,7 @@ class Select extends Etemplate\Widget $values[] = $key; } } - //error_log(__METHOD__."('$name', TRUE) options=".array2string($options).' --> values='.array2string($values)); + error_log(__METHOD__."('$name', TRUE) options=".array2string($options).' --> values='.array2string($values)); $options = $values; } //error_log(__METHOD__."('$name') returning ".array2string($options));