summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-19 02:37:29 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-19 02:37:29 +0000
commit1e8ee589bb8a413507239f0ddc5df01c82669b2d (patch)
tree93f1934dfb2e49c4dce9b7e8d6907014e5093c98
parent7952a651ce3bb2cfbad5ead1280ff24b347455fc (diff)
downloadbrdo-1e8ee589bb8a413507239f0ddc5df01c82669b2d.tar.gz
brdo-1e8ee589bb8a413507239f0ddc5df01c82669b2d.tar.bz2
#180063 by andremolnar, TheMystic, and R.Muilwijk: Add a parameter to form_set_error().
-rw-r--r--includes/form.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 06252cbf5..06482c230 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -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) {