summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-03-06 14:46:51 +0000
committerDries Buytaert <dries@buytaert.net>2006-03-06 14:46:51 +0000
commit21a3c24380511eb89a78a89aa6d8142909cb21fc (patch)
tree3a992edd09614e618cd61673e0093070c2632482 /includes
parentc16e5c4af0541be1382e1adde245e45f1bc2dc62 (diff)
downloadbrdo-21a3c24380511eb89a78a89aa6d8142909cb21fc.tar.gz
brdo-21a3c24380511eb89a78a89aa6d8142909cb21fc.tar.bz2
- Patch #52292 by hunmonk/chx: multipart node forms were broken.
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 086152496..e4f85f49b 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -171,7 +171,7 @@ function drupal_submit_form($form_id, $form, $callback = NULL) {
function _form_validate($elements, $form_id = NULL) {
/* Validate the current input */
if (!$elements['#validated']) {
- if ($elements['#input'] || isset($form_id)) {
+ if (isset($elements['#needs_validation'])) {
// An empty textfield returns '' so we use empty(). An empty checkbox
// and a textfield could return '0' and empty('0') returns TRUE so we
// need a special check for the '0' string.
@@ -316,9 +316,11 @@ function form_builder($form_id, $form) {
if ($posted) {
if (isset($edit)) {
$form['#value'] = $edit; // normal element
+ $form['#needs_validation'] = TRUE;
}
elseif (isset($form['#return_value'])) {
$form['#value'] = '0'; // checkbox unchecked
+ $form['#needs_validation'] = TRUE;
}
}
if (!isset($form['#value'])) {