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

- Patch #45845 by Jaza: Weight elements need default value of zero.

parent e54db453
Branches
Tags
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
......@@ -691,6 +691,18 @@ function checkboxes_value(&$form) {
$form['#value'] = $value;
}
/**
* If no default value is set for weight select boxes, use 0.
*/
function weight_value(&$form) {
if (isset($form['#default_value'])) {
$form['#value'] = $form['#default_value'];
}
else {
$form['#value'] = 0;
}
}
/**
* Roll out a single radios element to a list of radios,
* using the options array as index.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment