From a625ce4cab7dac1d9dc7fb96ce64055a9a9409c0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Sun, 11 Sep 2011 16:07:49 -0400 Subject: [PATCH] - Patch #240828 by sun, xjm, David_Rothstein, yoroy: 'This form is outdated. Reload the page and try again' is incorrect and confuses users. --- includes/form.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/form.inc b/includes/form.inc index cfbea38645b3..decca0037535 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1082,8 +1082,12 @@ function drupal_validate_form($form_id, &$form, &$form_state) { // matches the current user's session. if (isset($form['#token'])) { if (!drupal_valid_token($form_state['values']['form_token'], $form['#token'])) { + $path = current_path(); + $query = drupal_get_query_parameters(); + $url = url($path, array('query' => $query)); + // Setting this error will cause the form to fail validation. - form_set_error('form_token', t('This form is outdated. Reload the page and try again. Contact the site administrator if the problem persists.')); + form_set_error('form_token', t('The form has become outdated. Copy any unsaved work in the form below and then <a href="@link">reload this page</a>.', array('@link' => $url))); } } -- GitLab