It appears that when deleting a case, its comment's rows are not removed from the casetracker_comment_status table. They do seem to be removed on delete comment, however.

You can confirm by creating a case, adding a comment, noting its comment id, deleting the case, and then checking the sql tables for casetracker_comment_status that the row for that cid still exists.

As I stated If you delete a comment then this row IS removed, so the hook_comment on op delete is running then, but is NOT firing on case delete.. I'm still looking into it myself but I dont know enough about drupal to know whats up here so I'll throw it out to the community and maintainers.

Comments

jjrosent’s picture

I Believe

 $comment_results = db_query("SELECT cid FROM {comments} WHERE nid = %d", $node->nid);

is returning false so

        while ($comment_result = db_fetch_object($comment_results)) {
db_query("DELETE FROM {casetracker_comment_status} WHERE cid = %d", $comment_result->cid);
        } 

is never running

Looking into further....
..

nope no clue. It sure seems as though that while isnt being entered, and also that, the comment delete api also isnt catching....

jjrosent’s picture

Aha! I found an existing bug against core where hook_comment on op delete doesnt call the hooks. They refer to it as late as 7 but I believe its in 5 as well? -- killes was in on that discussion in January, maybe he can comment.

see: http://drupal.org/node/89181

If this is the same issue Im not sure how to handle, do we patch to make sure casetracker cleans up after itself or do we leave it, what do we mark this case?

jmiccolis’s picture

Version: 5.x-1.3-beta1 » master
Status: Active » Postponed

Changing version to HEAD and setting to 'postponed'. I hate that this is an issue, but it is relatively minor. Let's wait for core to fix this. If anyone wants to see this resolved please help with http://drupal.org/node/89181

pedrorocha’s picture

Status: Postponed » Closed (won't fix)

I'm cleaning the module issues, so if somebody thinks that this issue does make sense yet, feel free to reopen.