Closed (outdated)
Project:
Quote
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
4 Dec 2007 at 11:59 UTC
Updated:
19 Oct 2019 at 13:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
junyor commentedThis is really a rather difficult problem to solve. Before comment subjects are created from the comment body (when no subject was entered), lots of filtering and formatting is applied, including running all input filters. In other words, the "[quote]" stuff won't be in the comment body any more, making it very difficult to find the text that is unquoted. If you try to use the comment body prior to all this filtering and formatting, input filters will be bypassed and various other problems may occur.
I've been trying to think of a good solution for this, but haven't come up with anything yet. One possible solution is not to use the comment body, but the quoted item's title/subject. For instance, if you quote a node titled or comment with the subject "Foo bar", the comment subject would become "Re: Foo bar".
Comment #2
junyor commentedhttp://drupal.org/project/comment_subject implements the comment subject functionality I was talking about.
Below is some code I started working on to strip quotes. I abandoned it since I couldn't solve the input format problem. It won't work in its current state, but it should provide a good start if someone has some ideas.
Comment #3
ckngA patch to handle the auto subject generation.
This is how it works
- Insert form submission processing before the normal comment form_submit
- Strip the [quote ... [/quote] portion (not modifying the original comment)
- Set the subject title based on user comment body normally
Comment #4
ckngFixed a small bug where comment text was stripped when there is no quote.
Comment #5
Zen commentedVisual review only: if ($start) will not work when $start is 0. Shouldn't strict equality be used? (Please see Junyor's code for an example).
I also don't believe that this will work in previews and with nested quotes which are not all that uncommon.
Thanks.
Comment #6
Zen commentedComment #7
ivnish