Opened 5 years ago

Closed 20 months 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)

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 idangazit 5 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

This works just fine for me.

comment:2 Changed 5 years ago by idangazit

  • Resolution invalid deleted
  • Status changed from closed to reopened

This is a bug in webkit (aka Safari):

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 5 years ago by Alex

  • Component changed from django.contrib.comments to Documentation
  • Description modified (diff)
  • Summary changed from get_absolute_url doesn't add anchor to url to Comment's get_absolute_url anchor doesn't work in Safair
  • Triage Stage changed from Unreviewed to Accepted

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

comment:4 Changed 5 years ago by idangazit

  • Summary changed from Comment's get_absolute_url anchor doesn't work in Safair to Comment's get_absolute_url anchor doesn't work in Safari

Changed 5 years ago by idangazit

comment:5 Changed 5 years ago by idangazit

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

comment:6 Changed 3 years ago by SmileyChris

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

May as well reference the webkit bug url in our docs

comment:7 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:8 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:9 Changed 20 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from reopened to closed

In [51ee8507767c72807ad1e4e9982f5bef0e4413a5]:

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

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.