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.
Please add this somewhere in the comment_upload module (I added at line 243). Without it, you'll end up with a lot of "ghost" table entries, should folks delete their forum topics. With the correction to include nid in the file uploads fields (from a previous issue), this is the only area where data is left behind in a delete scenario.
<?php
function comment_upload_nodeapi(&$node, $op) {
#delete upload reference with forum topic
#most of this is taken care of elsewhere
switch ($op) {
case 'delete':
db_query('DELETE FROM {comment_files} WHERE nid = %d', $node->nid);
break;
}
}
?>
Comments
Comment #1
Heine CreditAttribution: Heine commentedThis is not a patch. Code above would leave stray files.
Comment #2
Heine CreditAttribution: Heine commentedFixed in 4.7.x-1.x-dev.
Comment #3
(not verified) CreditAttribution: commented