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.
Comment | File | Size | Author |
---|---|---|---|
comment_form_below.patch | 1.21 KB | hunmonk | |
Comments
Comment #1
Gábor HojtsyUnderstood (especially after some deeper IRC explanation). Thanks, committed.
Comment #2
dwworiginal patch applies without offsets, code is clean, etc.
Comment #3
drummcommitted to 5.x.
Comment #4
(not verified) CreditAttribution: commented