Opened 15 years ago

Closed 12 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 15 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Jacob, 15 years ago

Resolution: invalid
Status: newclosed

This works just fine for me.

comment:2 by Idan Gazit, 15 years ago

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 by Alex Gaynor, 15 years ago

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 by Idan Gazit, 15 years ago

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

by Idan Gazit, 15 years ago

comment:5 by Idan Gazit, 15 years ago

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

comment:6 by Chris Beaven, 13 years ago

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 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:8 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:9 by Tim Graham <timograham@…>, 12 years ago

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