Skip to content
Snippets Groups Projects
Commit a625ce4c authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #240828 by sun, xjm, David_Rothstein, yoroy: 'This form is outdated....

- Patch #240828 by sun, xjm, David_Rothstein, yoroy: 'This form is outdated. Reload the page and try again' is incorrect and confuses users.
parent 5b98347d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -1082,8 +1082,12 @@ function drupal_validate_form($form_id, &$form, &$form_state) { ...@@ -1082,8 +1082,12 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
// matches the current user's session. // matches the current user's session.
if (isset($form['#token'])) { if (isset($form['#token'])) {
if (!drupal_valid_token($form_state['values']['form_token'], $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. // 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)));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment