Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#13411 closed (fixed)

Some improvement for query string built by utils.next_redirect if next parameter contains '#' anchor

Reported by: timesong Owned by: nobody
Component: contrib.comments Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the comments app, views.utils.next_redirect appends a '?' and query string key/value pairs to the '#comment', so for example in template add '<input type="hidden" name="next" value="{{ article.get_absolute_url }}#comment" /></td>' will get 'http://www.example.com/articles/2#comment?c=7', it's incorrect.

Attachments (4)

patch01.patch (704 bytes ) - added by timesong 15 years ago.
comment-with-query-string-and-anchor-with-unittests.diff (1.8 KB ) - added by David Novakovic 14 years ago.
comment-with-query-string-and-anchor-with-unittests-doc.diff (1.8 KB ) - added by David Novakovic 14 years ago.
13411_comment_redirect_with_anchor.diff (2.4 KB ) - added by Julien Phalip 14 years ago.

Download all attachments as: .zip

Change History (12)

by timesong, 15 years ago

Attachment: patch01.patch added

comment:1 by Russell Keith-Magee, 15 years ago

Has patch: set
milestone: 1.2
Needs tests: set
Triage Stage: UnreviewedAccepted

Not critical for 1.2.

comment:2 by David Novakovic, 14 years ago

Patch now diffed against root of project and contains a test.

comment:3 by David Novakovic, 14 years ago

Fixed the docstring.

use the -doc patch.

comment:4 by jonasnockert, 14 years ago

Should/could this be marked as milestone 1.4?

For what it's worth, there's a little more information on Stack Overflow.

by Julien Phalip, 14 years ago

comment:5 by Julien Phalip, 14 years ago

milestone: 1.3
Needs tests: unset
Triage Stage: AcceptedReady for checkin

I've actually gotten bitten by this in one of my current projects. The patch looks good. I've just updated the test to make sure it works both with and without a query string.

comment:6 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

In [15720]:

Fixed #13411 -- Made sure URL fragments are correctly handled by the next_redirect utility of the comments apps. Thanks, timesong, dpn and Julien Phalip.

comment:7 by Jannis Leidel, 14 years ago

In [15721]:

[1.2.X] Fixed #13411 -- Made sure URL fragments are correctly handled by the next_redirect utility of the comments apps. Thanks, timesong, dpn and Julien Phalip.

Backport from trunk (r15720).

comment:8 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top