Skip to content
Snippets Groups Projects
Commit 9528c300 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

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

parent 5f829187
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment