Opened 7 years ago

Closed 4 years ago

#13344 closed Bug (wontfix)

Name collision for "next" template variable between contrib.comments and views.generic.list_detail

Reported by: Erik Stein Owned by: nobody
Component: contrib.comments Version: 1.2-beta
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Both the comment system (in post_comment and it's accompagnying forms) and the generic views system (in views.generic.list_detail's legacy template context stuff) use a template variabled named "next". The comment app's templates approve.html, delete.html, flag.html and preview.html render a hidden form field if next is not empty.

If you use for example the list_detail view with a template which renders a comment form for each list item, the comment form wrongly uses the next-value from the list_details view (the next page number). On posting the comment the user get's an 404 error, because the post_comment view now tries to redirect to a wrong URL containing the next page number.

Maybe it's generally a bad idea to use very simple context variable names like next in prepackaged apps.

Attachments (1)

13344.diff (5.3 KB) - added by Erik Stein 7 years ago.
Patch renaming the template variable to "post_comment_next". comment_tests ran successfully.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by Erik Stein

Attachment: 13344.diff added

Patch renaming the template variable to "post_comment_next". comment_tests ran successfully.

comment:1 Changed 7 years ago by Russell Keith-Magee

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 6 years ago by Julien Phalip

Component: Contrib appsdjango.contrib.comments

comment:3 Changed 6 years ago by Julien Phalip

Severity: Normal
Type: Bug

comment:4 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 Changed 4 years ago by Jacob

Resolution: wontfix
Status: newclosed

django.contrib.comments has been deprecated and is no longer supported, so I'm closing this ticket. We're encouraging users to transition to a custom solution, or to a hosted solution like Disqus.

The code itself has moved to; if you want to keep using it, you could move this bug over there.

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