Commit 58d9b02e authored by Dries's avatar Dries

- Patch #51189: fixed submit redirects.

parent 534c6d4f
......@@ -1115,11 +1115,6 @@ function node_filter_form_submit() {
case t('Reset'):
$_SESSION['node_overview_filter'] = array();
break;
case t('Update'):
return;
}
if ($op != '') {
return 'admin/node';
}
}
......@@ -1137,7 +1132,6 @@ function node_admin_nodes_submit($form_id, $edit) {
}
}
drupal_set_message(t('The update has been performed.'));
return 'admin/node';
}
}
......@@ -1874,9 +1868,16 @@ function node_form_submit($form_id, $edit) {
drupal_set_message(t('Your %post was created.', array ('%post' => node_get_name($node))));
}
}
if ($node->nid && node_access('view', $node)) {
return 'node/'. $node->nid;
if ($node->nid) {
if (node_access('view', $node)) {
return 'node/'. $node->nid;
}
else {
return '';
}
}
// it is very unlikely we get here
return FALSE;
}
/**
......
......@@ -1115,11 +1115,6 @@ function node_filter_form_submit() {
case t('Reset'):
$_SESSION['node_overview_filter'] = array();
break;
case t('Update'):
return;
}
if ($op != '') {
return 'admin/node';
}
}
......@@ -1137,7 +1132,6 @@ function node_admin_nodes_submit($form_id, $edit) {
}
}
drupal_set_message(t('The update has been performed.'));
return 'admin/node';
}
}
......@@ -1874,9 +1868,16 @@ function node_form_submit($form_id, $edit) {
drupal_set_message(t('Your %post was created.', array ('%post' => node_get_name($node))));
}
}
if ($node->nid && node_access('view', $node)) {
return 'node/'. $node->nid;
if ($node->nid) {
if (node_access('view', $node)) {
return 'node/'. $node->nid;
}
else {
return '';
}
}
// it is very unlikely we get here
return FALSE;
}
/**
......
......@@ -55,7 +55,7 @@ function system_perm() {
*/
function system_elements() {
// Top level form
$type['form'] = array('#method' => 'post', '#action' => request_uri(), '#redirect' => '');
$type['form'] = array('#method' => 'post', '#action' => request_uri(), '#redirect' => $_GET['q']);
// Inputs
$type['checkbox'] = array('#input' => TRUE, '#return_value' => 1);
......
......@@ -55,7 +55,7 @@ function system_perm() {
*/
function system_elements() {
// Top level form
$type['form'] = array('#method' => 'post', '#action' => request_uri(), '#redirect' => '');
$type['form'] = array('#method' => 'post', '#action' => request_uri(), '#redirect' => $_GET['q']);
// Inputs
$type['checkbox'] = array('#input' => TRUE, '#return_value' => 1);
......
......@@ -1034,7 +1034,7 @@ function user_pass_submit($form_id, $form_values) {
$mail_success = user_mail($account->mail, $subject, $body, $headers);
if ($mail_success) {
watchdog('user', t('Password reset instructions mailed to %name at %email.', array('%name' => '<em>'. $account->name .'</em>', '%email' => '<em>'. $account->mail .'</em>')));
watchdog('user', t('Password reset instructions mailed to %name at %email.', array('%name' => '<em>'. $account->name .'</em>', '%email' => '<em>'. $account->mail .'</em>')));
drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
}
else {
......@@ -1220,7 +1220,7 @@ function user_register_submit($form_id, $form_values) {
$body = _user_mail_text('welcome_body', $variables);
user_mail($mail, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
return '';
}
else {
// Create new user account, administrator approval required.
......
......@@ -1034,7 +1034,7 @@ function user_pass_submit($form_id, $form_values) {
$mail_success = user_mail($account->mail, $subject, $body, $headers);
if ($mail_success) {
watchdog('user', t('Password reset instructions mailed to %name at %email.', array('%name' => '<em>'. $account->name .'</em>', '%email' => '<em>'. $account->mail .'</em>')));
watchdog('user', t('Password reset instructions mailed to %name at %email.', array('%name' => '<em>'. $account->name .'</em>', '%email' => '<em>'. $account->mail .'</em>')));
drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
}
else {
......@@ -1220,7 +1220,7 @@ function user_register_submit($form_id, $form_values) {
$body = _user_mail_text('welcome_body', $variables);
user_mail($mail, $subject, $body, "From: $from\nReply-to: $from\nX-Mailer: Drupal\nReturn-path: $from\nErrors-to: $from");
drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
return '';
}
else {
// Create new user account, administrator approval required.
......
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