Commit 1e8ee589 authored by webchick's avatar webchick

#180063 by andremolnar, TheMystic, and R.Muilwijk: Add a parameter to form_set_error().

parent 7952a651
......@@ -777,12 +777,17 @@ function form_execute_handlers($type, &$form, &$form_state) {
* element where the #parents array starts with 'foo'.
* @param $message
* The error message to present to the user.
* @param $reset
* Reset the form errors static cache.
* @return
* Never use the return value of this function, use form_get_errors and
* form_get_error instead.
*/
function form_set_error($name = NULL, $message = '') {
function form_set_error($name = NULL, $message = '', $reset = FALSE) {
static $form = array();
if ($reset) {
$form = array();
}
if (isset($name) && !isset($form[$name])) {
$form[$name] = $message;
if ($message) {
......
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