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

Heine’s picture

Status: Needs review » Active

This is not a patch. Code above would leave stray files.

Heine’s picture

Status: Active » Fixed

Fixed in 4.7.x-1.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)