So, I'm looking at this section from multiform_get_form():
// Retrieve buttons.
if ($button_elements = form_get_cache($_POST['form_build_id'], $form_state_save)) {
foreach ($button_elements as $button) {
// For each button, save it's name. Later on we will need the button
// names because the buttons are used in the multiform but their values
// in $_POST (if it exists) needs to be handed down to each form so
// those can recognize the button press.
$name = isset($button_elements['#name']) ? $button_elements['#name'] : 'op';
$button_names[$name] = $name;
}
}
That doesn't seem to work - for each $button in $button_elements... get the #name from $button_elements? If you want the name from $button_elements, why is there even a foreach here? It seems to make more sense if this is looking at $button['#name'] instead.
This probably seems to work because most buttons are 'op' on a form.
Comments
Comment #1
jcfiala commentedAnd to back that up, here's a patch for review.
Comment #2
joseph.olstadwake up testbot (I just fixed the simple test so expecting this to pass)
Comment #3
joseph.olstadComment #4
joseph.olstad$name was out of scope on patch 4
Comment #6
joseph.olstadComment #7
joseph.olstadthis is in 7.x-1.x dev
Comment #9
joseph.olstadthis change was finally released in 7.x-1.4
Thanks jcfiala !