Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The comment module currently does not support 3rd party modules being able to add form elements or form validation. This is important for the captcha module to be able to add an extra form item.
Comment | File | Size | Author |
---|---|---|---|
#17 | comment.module_11.patch.txt | 710 bytes | meba |
#14 | comment.module_10_0.patch | 1.02 KB | koorneef |
#12 | comment.module_9.patch | 698 bytes | Hanu |
#9 | comment.module_7.patch | 674 bytes | jotarp@www.jotarp.org |
#1 | comment.form.patch | 824 bytes | tangent |
Comments
Comment #1
tangent CreditAttribution: tangent commentedHere is a patch.
Comment #2
(not verified) CreditAttribution: commentedHaven't tested it, but it seems identical to the changes I'd made for my experiments.
+1 for this. This is important to have if people want captchas on comments.
Other modules that I think can benefit by this: Ratings (rate the post along with commenting on it).
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedthis is a good direction for hook_comment(). for consistency with nodeapi, i propose splitting into 'form pre' and 'form post' operations and also adding a 'view' operation.
Comment #4
tangent CreditAttribution: tangent commentedI agree with the commentapi thing (however it is named or done) for several reasons. In the short term though, in order to use a captcha module immediately, it wouldn't hurt to update the existing code to support the purpose since I suspect the aforementioned redesign will not happen overnight.
Comment #5
TDobes CreditAttribution: TDobes commentedThere's a similar discussion going on in another issue... one of these should be marked as a duplicate.
Comment #6
Stefan Nagtegaal CreditAttribution: Stefan Nagtegaal commentedJust not to forget:
If such a patch like this makes it into core it would be nice to strip down the comment.module untill it is a real api.
Removing the comment moderation part into an cmoderation.module would be a good thingtm. This way we make drupal more flexible and light weight...
Comment #7
Stefan Nagtegaal CreditAttribution: Stefan Nagtegaal commentedDuplicate of http://drupal.org/node/13539..
Comment #8
escoles CreditAttribution: escoles commentedI'm not clear on how to apply this patch. The name of the file is "comment.form", not "comment.module"; is that simply an error? Or should I be able to find a resource somewhere with the filename "comment.form"?
Related question: If I operate on the assumption that the filename should be "comment.module" and try to run patch, I get the error message "Only garbage was found in the patch input." Does anybody know what that would mean?
Comment #9
jotarp@www.jotarp.org CreditAttribution: jotarp@www.jotarp.org commentedTry this.
Comment #10
jgoerzen@changelog.complete.org CreditAttribution: jgoerzen@changelog.complete.org commentedI'm running Drupal 4.6.0 with the attached patch 7. It has been causing me all sorts of weird session troubles. Reversing the patch makes the troubles go away.
Something is really awry here...
Comment #11
varunvnair CreditAttribution: varunvnair commentedIs comment.module_7.patch still causing problems, esp with Drupal 4.6.1? Just wanted to know because I wanted to enable captchas for anon users and was thinking of applying this patch.
Comment #12
Hanu CreditAttribution: Hanu commentedThis patch works for me and my 4.6.2 installation.
Comment #13
eaton CreditAttribution: eaton commentedThat above patch (v 9) Works for me on 4.6.2 as well. I'm using it in a new custom module to impose length limits on comments, very very useful.
Comment #14
koorneef CreditAttribution: koorneef commentedAttached patch is for CVS (post 4.6.2, dd: 2005-08-07).
Please check the patch for errors. It works on my test site but one never knows ....
Comment #15
moshe weitzman CreditAttribution: moshe weitzman commentedit seems that the patch at http://drupal.org/node/28255 is more consistent with nodeapi and more thorough. if someone else agrees, please mark this issue as a dupe of that one.
Comment #16
tangent CreditAttribution: tangent commentedMarking as dupe of http://drupal.org/node/28255. This issue seems to have been worked around with formapi.
Comment #17
meba CreditAttribution: meba commentedWell, this is duplicate, but applying that patch to Drupal 4.6.6 is a pain. Attaching this patch ported to work with 4.6.6
Comment #18
pasupathymahalingam CreditAttribution: pasupathymahalingam commentedI found out that in 4.7.3, if you want to add fields into comment form you can extend it by implementing hook_comment() as follows
function _comment($comment, $op)
{
if ($op == 'form') {
$form[''] = array(
'#type' => '',
'#title' => t(''),
'#required' => TRUE,
'#weight' => 0,
);
return $form;
}
}
Comment #19
wundo CreditAttribution: wundo commented4.7 Branch already support comment hook.