Commit 9528c300 authored by Dries's avatar Dries

- Patch #45281 by flevour/chx: fixed problem with categories not being set properly on editing.

parent 5f829187
......@@ -477,7 +477,7 @@ function theme_select($element) {
if (is_array($choice)) {
$select .= '<optgroup label="'. $key .'">';
foreach ($choice as $key => $choice) {
if ($value_valid && ($element['#value'] == $key || ($value_is_array && in_array($key, $element['#value'])))) {
if ($value_valid && ($element['#value'] == $key || ($value_is_array && isset($element['#value'][$key])))) {
$selected = ' selected="selected"';
}
else {
......@@ -488,7 +488,7 @@ function theme_select($element) {
$select .= '</optgroup>';
}
else {
if ($value_valid && ($element['#value'] == $key || ($value_is_array && in_array($key, $element['#value'])))) {
if ($value_valid && ($element['#value'] == $key || ($value_is_array && isset($element['#value'][$key])))) {
$selected = ' selected="selected"';
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment