0

I am subscribed to a Drupal 5 site with the Advanced Forum module. When a user decides to delete her post, the post dissappears and the following posts are moved up.

So if #2 is deleted the existing #3 will become #2 and so forth. The problem with this is if people reference previous posts which are now incorrectly numbered. Consequently it can lead to much confusion or even make people angry because they feel a comment is not appropriate - which it isn't after all!

What we would like is that the deleted post is simply removed without renumbering the rest. There is no option for this in the settings, so I will most likely have to mod the files.

Do you know if there already exists a patch to accomplish this, or can you alternatively point to where I need to modify the code?

I am a experienced PHP developer, but Drupal is new to me.

Laxman13
  • 5,226
  • 3
  • 23
  • 27
marlar
  • 3,858
  • 6
  • 37
  • 60

1 Answers1

1

Possible workaround would be to set status field in comment table to 0, instead of deleting the comment. THat way it would not appear in comment list and other cid's would not be changed. You could do this in a custom module with a hook but I am not sure what hook calls comment_delete, normally you would override hook_nodeapi but comments if I remember correctly may be handled differently than nodes.

Look in the comment module under /modules and check out from what hook comment_delete is called and override that in a custom module, that way you would not have to hack any core code.

Good-luck

Stephane Gosselin
  • 9,030
  • 5
  • 42
  • 65
  • Setting the statusflag to 0 doesn't hide the comment. In fact, it is already 0. I googled and found this http://drupal.org/node/11804 that explains that 1 means unpublished in the comment table, but setting it to 1 doesn't hide it either. So apparently the status field is not used at all. Anyway, you guided me in the right direction in that I have found the exact function that deals with comment deletion. If anything else fails, I can simply erase the comment body and leave the comment intact - that it is as good as deleting it completely. – marlar May 26 '11 at 19:40
  • Well, setting the status flag to 1 DOES hide the comment. It turned out that because I am admin I (of course) see the unpublished comments! Very obvious actually :-) – marlar May 26 '11 at 22:01
  • Hey! Great :) Happy you made some headway on your issue! – Stephane Gosselin May 27 '11 at 03:23