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

- Patch #1059184 by yched: warnings in list_update_7001 (edge cases).

parent 0a50c581
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
......@@ -61,7 +61,7 @@ function list_update_7001() {
$allowed_values = _list_update_7001_extract_allowed_values($allowed_values, $position_keys);
// Additionally, float keys need to be disambiguated ('.5' is '0.5').
if ($field['type'] == 'list_number') {
if ($field['type'] == 'list_number' && !empty($allowed_values)) {
$keys = array_map(create_function('$a', 'return (string) (float) $a;'), array_keys($allowed_values));
$allowed_values = array_combine($keys, array_values($allowed_values));
}
......
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