Skip to content

Commit

Permalink
Merge pull request pressflow#10 from dawehner/form-callbable
Browse files Browse the repository at this point in the history
Make it possible to use any kind of callable as submit handlers
  • Loading branch information
LionsAd committed Nov 21, 2014
2 parents 8c70857 + 8417887 commit c84f7e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
}

foreach ($handlers as $function) {
if (function_exists($function)) {
if (is_callable($function)) {
// Check to see if a previous _submit handler has set a batch, but
// make sure we do not react to a batch that is already being processed
// (for instance if a batch operation performs a drupal_execute()).
Expand All @@ -828,7 +828,7 @@ function form_execute_handlers($type, &$form, &$form_state) {
$batch['sets'][] = array('form_submit' => $function);
}
else {
$function($form, $form_state);
call_user_func_array($function, array($form, &$form_state));
}
$return = TRUE;
}
Expand Down

0 comments on commit c84f7e8

Please sign in to comment.