Skip to content
Snippets Groups Projects
Commit d1c46ead authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#187391 by jrbeeman, catch: redirect user to proper node comment page after...

#187391 by jrbeeman, catch: redirect user to proper node comment page after submitting a new comment
parent 207e6f14
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
......@@ -1444,7 +1444,9 @@ function _comment_form_submit(&$comment_values) {
function comment_form_submit($form, &$form_state) {
_comment_form_submit($form_state['values']);
if ($cid = comment_save($form_state['values'])) {
$form_state['redirect'] = array('node/'. $form_state['values']['nid'], NULL, "comment-$cid");
$node = node_load($form_state['values']['nid']);
$page = comment_new_page_count($node->comment_count, 1, $node);
$form_state['redirect'] = array('node/'. $node->nid, $page, "comment-$cid");
return;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment