Commit 8c19958a authored by Aaron Wells's avatar Aaron Wells

Prevent global form error from incorrectly showing up on forms with button-submit functions

Bug 1311940: There's an obscure pieforms feature where a form can have multiple submit
buttons, and each submit button can have its own submit callback function named
{formname}_submit_{buttonname}. These functions are supposed to redirect at the end.
If they don't, due to a bug in the implementation of the global form message we currently show
an error message at the top of the form saying there was something wrong with the user's
submission. Instead, we should just let the form go through, and log a debug message for
the devs.

Change-Id: Ib0e9b7e2f58737c9c736bdd1c033bc020985a60b
parent 04ff27b2
......@@ -513,8 +513,8 @@ class Pieform {/*{{{*/
$function = "{$this->data['successcallback']}_{$name}";
if (function_exists($function)) {
$function($this, $values);
$submitted = true;
break;
log_debug('button-submit form ' . $function . ' should provide a redirect.');
return;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment