summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 2d13ed142..24ca88544 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -692,6 +692,18 @@ function checkboxes_value(&$form) {
}
/**
+ * 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.
*/