Opened 14 years ago

Closed 11 years ago

#9967 closed Cleanup/optimization (fixed)

Comment's get_absolute_url anchor doesn't work in Safari

Reported by: msm Owned by: nobody
Component: Documentation Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

Maybe I'm wrong, but calling get_absolute_url on a comment is redirected to this:

16	urlpatterns += patterns('',
17	    url(r'^cr/(\d+)/(\w+)/$', 'django.views.defaults.shortcut', name='comments-url-redirect'),
18	)

In my case this somehow doesnt return the anchor of a comment (so that the browser directly jumps to the comment text (e.g. /slug-of-article/#c123

EDIT: We just need to document that the anchor is lost on redirect in Safari (works in Firefox and Chrome. IE status unkown).

Attachments (1)

r10753_comment_linking_docs.diff (1.3 KB) - added by Idan Gazit 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 14 years ago by Jacob

Resolution: invalid
Status: newclosed

This works just fine for me.

comment:2 Changed 14 years ago by Idan Gazit

Resolution: invalid
Status: closedreopened

This is a bug in webkit (aka Safari): https://bugs.webkit.org/show_bug.cgi?id=24175

Web servers don't understand anchors because they're not part of proper URLs. Nominally, the browser is supposed to remember the named anchor, and reapply it after the redirect.

Safari doesn't behave correctly, and "forgets" the named anchor. In the case of the comments framework, this means that Safari browsers will end up on the right page but not at the anchor.

comment:3 Changed 14 years ago by Alex Gaynor

Component: django.contrib.commentsDocumentation
Description: modified (diff)
Summary: get_absolute_url doesn't add anchor to urlComment's get_absolute_url anchor doesn't work in Safair
Triage Stage: UnreviewedAccepted

Edited title, added a note to the description describing the new reality.

comment:4 Changed 14 years ago by Idan Gazit

Summary: Comment's get_absolute_url anchor doesn't work in SafairComment's get_absolute_url anchor doesn't work in Safari

Changed 14 years ago by Idan Gazit

comment:5 Changed 14 years ago by Idan Gazit

previous patch incorrectly separated the ".. templatetag:: get_comment_count" and the "Counting Comments" section.

comment:6 Changed 12 years ago by Chris Beaven

Has patch: set
Patch needs improvement: set
Severity: Normal
Type: Cleanup/optimization

May as well reference the webkit bug url in our docs

comment:7 Changed 11 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 Changed 11 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 Changed 11 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: reopenedclosed

In [51ee8507767c72807ad1e4e9982f5bef0e4413a5]:

Fixed #9967 - Added a link to a bug that affects contrib.comments redirects.

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