By droopy on
There has been sporadic discussion about the possibility of converting comments (and their dependent threads) to new nodes, eg:
http://drupal.org/node/3489
http://drupal.org/node/11877
http://drupal.org/node/38249
Is anything happening? It would be very helpful to have this functionality - in fact for me it's becoming a critical need. Does some sort of incentive need to be offered?
Comments
Don't hold your breath.
Don't hold your breath.
I recall some devs are against making the move to using nodes anytime soon.
--
www.bargainspy.co.uk | More Drupal modules
--
Ixis (UK): Drupal support, Drupal hosting.
Sorry, that wasn't really my
Sorry, that wasn't really my point. What I'm looking for (it's clear from the linked discussions) is the functionality (I guess by means of a module) to start a new thread from a comment.
It's very easy for people to go off at a tangent as they join in a conversation, and it would be helpful to be able to cut that branch of the discussion off and replant it as a new thread - so the first comment in the pruned section would need to be converted to a node but dependent comments would remain attached to it. Ideally a marker would be left in the old thread to indicate the editing that had been done.
Surely this counts as basic management of content.
Don't give up!
I hacked the
comment.moduleto allow for this, but, as everyone knows, hacking core is bad in the long run.Now, I'm working on switching everything over to a module.
It's not ready yet, but I wanted to go ahead and post here so that I could track the thread (so it doesn't get lost amid all the other activity), and also to see if you are still interested.
Absolutely still interested!
Absolutely still interested! It would be a godsend. I wouldn't mind getting my hands on your hacked comment module either. Is it for 4.6?
module's done!
how can I send it to you?
I can send you my copy of the hacked
comment.module, too, but it is always better in the long run to use a module. I wrote it using 4.6.4 (haven't upgraded to 4.6.5 yet).BTW, this does leave a comment in the original location where the comment was moved from, with a message linking to the new location.
The only advantage to the hacked core is that, when a comment has been moved, it prevents the "reply" and "edit" links from appearing. Otherwise, the two function identically.
One other thing: Each node can potentially save information in a different way. As such, this is not a blanket solution, since I know of no way to anticipate every possible node type that someone may devise. Therefore, I have written this module to only work with the forum node type, since I presume that is where most discussions would take place. There are just too many different ways to handle other situations. That being said, if you need another node type addressed, then we can look at that particular type, and develop a strategy for handling it.
Even if this particular attempt is not quite what you need, I hope this works out for you in the long run... I've pulled out too much hair for it not to! :)
There is no reason to not
There is no reason to not submit this as a patch for review and feedback. Dries has mentioned that for 4.8 and beyond he wants to look at ways to improve forums module. So, your strategy may prove to be an approach that is attractive. It may not.
It will also be in the patch queue for others to take advantage of if they so choose.
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Could you send it via my
Could you send it via my contact form? Either paste the code in, or send me an email and I'll reply to you. I presume it's not a good idea to post the email address in this reply. I'd like to try the hacked comment module too.
My need currently is to convert comments from both forum posts and stories to both forum posts and stories, though in practice the distinction between stories and forum posts is rather blurred, and I have been thinking of getting rid of the forum structure altogether. Anyway, if it does half of what I need, I will be delighted! Thanks.
module way...
I decided to post the code here, just in case someone else wanted to see the code. I decided against hacking the comment module, since the changes were fairly extensive, which would cause issues when upgrading. Besides, the same effect can be achieved having a stand alone module and adding three lines to the appropriate function (discussed later in this post). I might submit this as a new feature patch to the comments module, but I don't know if it is something desired for core. *shrug*
Copy and paste the following code into a file named
comment_split.module. Enable it, and it will work for both stories and forums (Drupal 4.6).(Believe it or not, but I did put blank lines between the functions and sections of code, but the
<php>tags remove them all.)If you want to hide the "edit" and "reply" links for when a comment has been moved, then add the following around line 704 of
comment.module, in thecomment_links()function, just before thereturn $links;statement:Using
function_existskeeps this from breaking the module should you deactivate thecomment_splitmodule.This module makes use of user roles so that you can allow moderators to split comments, if desired.
Sorry it took a few days to get this out... things got hectic at work.
Let me know if there are any problems!
This is going to be a great
This is going to be a great help for me. Many thanks for putting it together.
It seems to work very well, but a couple of issues:
1. I had to remove the line
print theme('page', $content);from the 'confirm request' part of comment_split_convert because the confirmation page was printing twice. I know next to nothing about PHP so could you confirm that this is correct?
2. I changed the following line in the 'convert the comment into a node' section
$node->body = $node->comment;to
$node->body = '[New post created by admin from: ' . l(t($node->title), 'node/' . $node->nid . '#comment-' . $cid) . ']<br>' . $node->comment;to show where the new post had been taken from. Is there a better way of doing this?
glad it works for you.
1. I have to laugh about the duplicate content. Would you believe that I never scrolled down far enough in the page to see that it was being printed twice? Thanks for catching the redundancy.
2. Customizing the new node's text is not a problem, either. One consideration, though: This module lets others split comments, too (if you give them permission, that is), so you may want to code this in such a way as to allow the admin (or moderator) name to be put in dynamically.
Upgrade of comment_split module to 4.7
This module has been invaluable for me. Are there plans to upgrade it to 4.7?