Seems the #anchor is getting encoded by the drupal_urlencode function.
We need to either pull it out of the function call, or patch the drupal_urlencode function.

Comments

Arto’s picture

Hmm... I believe passing the anchor to drupal_urlencode() is intentional and desirable, since the anchor #comment_form doesn't apply to the login page, but rather to the post-login redirect as specified by the destination= parameter.

This means the bug is either in drupal_urlencode() or the post-login redirection code.

Arto’s picture

Note related issue #88050.

andeeeb’s picture

StatusFileSize
new690 bytes

I ran into the same problem. I fixed it by adding urldecode to drupal_goto.

pwolanin’s picture

Version: 4.7.3 » x.y.z
Priority: Normal » Critical

This bug is present in 4.7 an dHEAD and currently manifests on drupal.org itself.

Marking as critical, since it's obviously going to leave a very bad impression on any new user who gets a "page not found" when first registering or logging in.

flk’s picture

Title: clicking login from the url under a comment produces 404 error » clicking login from the url under a comment produces 404 error (clean urls)
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new859 bytes

This problem only occurs when site is using clean urls, drupal_urlencode prepends %25 to #(%23) and &(%26) when clean urls is true...

Rerolled patch against head and have tested the patch from #3 and it does solve the problem. since the values of destination are sent to drupal_goto, i think it is fine to have urldecode there (cant see anwhere else of putting it :( )....

another way of going about this is to not urlencode the destination values when clean url is on. (doesnt sound like a good to me.)

flk’s picture

Status: Reviewed & tested by the community » Needs review
drumm’s picture

Status: Needs review » Fixed

Committed to HEAD.

beginner’s picture

Version: x.y.z » 4.7.4
Status: Fixed » Reviewed & tested by the community
Zen’s picture

Component: comment.module » base system
Priority: Critical » Normal
StatusFileSize
new835 bytes

backport.

@andeeeb: Please create patches against the base Drupal directory; i.e. your patch should be a diff for includes/common.inc rather than drupal/includes/common.inc.

-K

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

applied

Anonymous’s picture

Status: Fixed » Closed (fixed)