Commit 9528c300 authored by Dries's avatar Dries
Browse files

- 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) { ...@@ -477,7 +477,7 @@ function theme_select($element) {
if (is_array($choice)) { if (is_array($choice)) {
$select .= '<optgroup label="'. $key .'">'; $select .= '<optgroup label="'. $key .'">';
foreach ($choice as $key => $choice) { 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"'; $selected = ' selected="selected"';
} }
else { else {
...@@ -488,7 +488,7 @@ function theme_select($element) { ...@@ -488,7 +488,7 @@ function theme_select($element) {
$select .= '</optgroup>'; $select .= '</optgroup>';
} }
else { 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"'; $selected = ' selected="selected"';
} }
else { 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