Fix option groups only kept the first group

This commit is contained in:
nathan 2023-01-11 14:20:31 -07:00
parent 9aea7be231
commit bc4423498a

View File

@ -429,7 +429,7 @@ class Select extends Etemplate\Widget
// so check here, as we re-index
// Duplicates might happen if app programmer isn't paying attention and
// either uses the same ID in the template, or adds the options twice
$check_value = (string)(is_array($label) && array_key_exists('value', $label) ? $label['value'] : $value);
$check_value = (string)(is_array($label) && array_key_exists('value', $label) && !is_array($label['value']) ? $label['value'] : $value);
if (isset($values[$check_value]))
{
unset($options[$value]);