From ea79c66c033fc835fc404d6ca751189414ae734e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= <gabor@hojtsy.hu> Date: Fri, 25 Jan 2008 16:24:48 +0000 Subject: [PATCH] #194327 by dvessel, David_Rothstein, catch, theborg: IE form submission button correction was buggy --- includes/form.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index 6d562e57757d..9a28ddf73af8 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -907,9 +907,14 @@ function form_builder($form_id, $form, &$form_state) { // Now that we've processed everything, we can go back to handle the funky // Internet Explorer button-click scenario. _form_builder_ie_cleanup($form, $form_state); - - // After handling the special IE case, we no longer need the buttons collection. - unset($form_state['buttons']); + + // We shoud keep the buttons array until the IE clean up function + // has recognized the submit button so the form has been marked + // as submitted. If we already know which button was submitted, + // we don't need the array. + if (!empty($form_state['submitted'])) { + unset($form_state['buttons']); + } // If some callback set #cache, we need to flip a static flag so later it // can be found. -- GitLab