in working on issue followups as comments, i ran into a pesky bug w/ the way the comment form is rendered. comment_render() slaps the comment form below the last comment if the comment setting for 'Location of comment submission form' is set to 'Display below post or comments'.

for project issue, we want the issue thread displayed below the new comment when 'reply' is clicked, and also for comment previews -- which is accomplished by form_altering the comment form to add the node view when you're at /comment/reply. this throws things into an endless loop, though -- because when comment_render is called is tries to build the comment form again.

attached patch is the most sensible solution i think. the code should specifically disallow rendering the comment form when you're already on it :) in my reading of the code, the comment form is only displayed a) on the node form below the last comment, or b) at /comment/reply. there is no problem with a), so the patch deals directly with testing for b) before it renders the form.

CommentFileSizeAuthor
comment_form_below.patch1.21 KBhunmonk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Version: 6.x-dev » 5.x-dev
Status: Needs review » Patch (to be ported)

Understood (especially after some deeper IRC explanation). Thanks, committed.

dww’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

original patch applies without offsets, code is clean, etc.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

committed to 5.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)