function discussthis_node_delete in Discuss This! 7
Same name and namespace in other branches
- 7.2 discussthis.node.inc \discussthis_node_delete()
Implements hook_node_delete().
File
- ./
discussthis.node.inc, line 261 - File with node discussion display methods.
Code
function discussthis_node_delete($node) {
// drop any reference to that node
//
// PROBLEM: Note that if someone just initiated a "Discuss this"
// form, then they will have a surprise when saving since the
// page will be gone. I don't see any way around that though.
//
$sql = 'DELETE FROM {discussthis} WHERE nid = %d OR topic_nid = %d';
// TODO Please review the conversion of this statement to the D7 database API syntax.
/* db_query($sql, $node->nid, $node->nid) */
db_delete('discussthis')
->condition('nid', $node->nid)
->execute();
}