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

- Patch #84250 by yched and Moshe: providing a path with query string breaks the confirmation form.

parent ad1c9e69
No related branches found
No related tags found
No related merge requests found
...@@ -2075,7 +2075,7 @@ function system_theme_settings($key = '') { ...@@ -2075,7 +2075,7 @@ function system_theme_settings($key = '') {
* @param $question * @param $question
* The question to ask the user (e.g. "Are you sure you want to delete the * The question to ask the user (e.g. "Are you sure you want to delete the
* block <em>foo</em>?"). * block <em>foo</em>?").
* @param $path * @param $destination
* The page to go to if the user denies the action. * The page to go to if the user denies the action.
* @param $description * @param $description
* Additional text to display (defaults to "This action cannot be undone."). * Additional text to display (defaults to "This action cannot be undone.").
...@@ -2089,8 +2089,9 @@ function system_theme_settings($key = '') { ...@@ -2089,8 +2089,9 @@ function system_theme_settings($key = '') {
* @return * @return
* The form. * The form.
*/ */
function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm') { function confirm_form($form, $question, $destination, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm') {
$description = ($description) ? $description : t('This action cannot be undone.'); $description = ($description) ? $description : t('This action cannot be undone.');
extract(parse_url($destination));
drupal_set_title($question); drupal_set_title($question);
$form['#attributes'] = array('class' => 'confirmation'); $form['#attributes'] = array('class' => 'confirmation');
$form['description'] = array('#value' => $description); $form['description'] = array('#value' => $description);
...@@ -2098,7 +2099,7 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, ...@@ -2098,7 +2099,7 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL,
$form['actions'] = array('#prefix' => '<div class="container-inline">', '#suffix' => '</div>'); $form['actions'] = array('#prefix' => '<div class="container-inline">', '#suffix' => '</div>');
$form['actions']['submit'] = array('#type' => 'submit', '#value' => $yes ? $yes : t('Confirm')); $form['actions']['submit'] = array('#type' => 'submit', '#value' => $yes ? $yes : t('Confirm'));
$form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path)); $form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path, null, $query, $fragment));
$form['#base'] = 'confirm_form'; $form['#base'] = 'confirm_form';
return $form; return $form;
} }
......
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