Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
comment.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Sep 2009 at 17:41 UTC
Updated:
20 May 2012 at 14:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
pwolanin commentedComment #2
sunTagging.
Comment #3
pwolanin commentedLooks like we already have the necessary help function to find the page.
Comment #5
pwolanin commentedThis changes the behavior less (so the test should pass) and also fix a couple little bits of odd/broken code.
Comment #6
sunI think we can simply move the $page = ... into the if() here, no?
Why not \d ?
This review is powered by Dreditor.
Comment #7
pwolanin commented@sun - I don't understand the first comment - we have to find the value for $page before we can test it.
I find [0-9] much more readable at first glance versus \d, but that's personal preference.
Comment #8
sun...should be the same?
Comment #9
pwolanin commented@sun - functionally the same, but probably less clear about what we are testing.
Comment #10
sunComment #11
catchJust a note that this partially circumvents the comment permalinks - however I think that's a good trade-off to keep the context of the node url (and possibly alias) when posting a comment on it, so +1.
Comment #12
dries commentedThis looks nice and easy. Committed to CVS HEAD.
Would be great to have tests, so marking this 'code needs work'.
Comment #13
tic2000 commentedI opened yesterday #583296: Comment form redirect is hardcoded without knowing of this issue, and I looked for a comment redirect issue (I think, so a -1 for me).
Why is the redirect added to the submit function so there is no way to form alter it? You can only circumvent it by hacking core.
Comment #14
pwolanin commented@tic2000 - you can add another submit handler that runs after this one and changes the redirect path. Why do you have to hack anything?
Comment #15
catchWe already have tests for this, which work regardless of the specific URL and went in with the original patch - this is only a cosmetic change, doesn't change what's outside the address bar:
Comment #17
purabdk commentedI solved the issue using following code. you can put following code in your module.
function modulename_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'comment_form') {
$form['#action'] = request_uri();
$form['#submit'][] = 'noredirect_comment_form_submit';
}
}
/**
* Implementation of hook_comment_form_submit().
*/
function comment_no_redirect_comment_form_submit(&$form, &$form_state) {
$form_state['redirect'] = ltrim($form['#action'], '/');
}
Comment #18
ayesh commentedI have also created a (sandbox) module that redirects comment/cid to node/nid/?page=x#comment-cid URLs by altering the page callback of the comment/cid pages.
http://drupal.org/sandbox/Ayesh/1578662
To be honest I'm not sure if this is a good way to alter things but it works.