Closed (won't fix)
Project:
Merge comments
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
29 Sep 2010 at 21:59 UTC
Updated:
11 Jul 2012 at 03:06 UTC
No module exists for merging double posts/comments in D6... is there a possibility of a backport to D6?
Comments
Comment #1
RazvanRanca commentedI initially wanted to make this for drupal 6, but i couldn't figure out a good way of doing it(as in without changing the database by myself which might screw up other modules).
Drupal 7 introduced this http://api.drupal.org/api/function/hook_comment_presave/7 hook, which i use. Drupal 6 doesn't have a presave action in http://api.drupal.org/api/function/hook_comment/6 .
However, if anybody has any ideas on how it may be done in drupal 6, please let me know and I'll look into it.
Until then I'm marking this as won't fix.
Comment #2
RazvanRanca commentedHmm, i kept thinking about this and maybe it's possible after all, I'm not sure.
I added the basic functionality in a 6.x dev version, but right now it's doing the hack the database thing i mentioned above. I'm thinking if i can programatically simulate a comment edit and delete and invoke all other interested modules in the process this might work.
I'm going to try to figure this out.
Comment #3
cor3huis commentedMake sure you use D6.20 or higher, the code is in flux. It is best to take a look in comment.module since API documentation is sometimes incorrect.
You options possibly:
- comment_nodeapi with using $OP in a switch
- comment_presave($edit)
Investigating presave for comment changed and created myself...
Comment #4
RazvanRanca commentedI've looked into this again, but I can't seem to find a way to do it better.
hook_nodeapi doesn't work because the presave hook is only called when nodes are created, not comments.
A comment presave hook doesn't seem to exist in drupal 6
And though it's possible to modify a comment at the validation stage, the modifications don't seem to carry through, the comment being written in the database in it's original form.
Since I can't find a way to improve on this implementation I'll have to close these backport issues.