API page: http://api.drupal.org/api/drupal/modules--node--node.api.php/function/ho...
Describe the problem you have found:
Documentation reads:
function hook_delete($node) {
db_delete('mytable')
->condition('nid', $nid->nid)
->execute();
} Should read:
function hook_delete($node) {
db_delete('mytable')
->condition('nid', $node->nid)
->execute();
} $nid->nid needs to be changed to $node->nid.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | hook_delete-1205882-2.patch | 377 bytes | Psikik |
Comments
Comment #1
jhodgdonGood catch, thanks for reporting this! Quick patch to make for someone...
Comment #2
Psikik commentedHere's the patch for 8.x
I was also checking to apply this to 7.x, but the function seems to be correct in the 7.x branch. So removing backport tag.
Comment #3
jhodgdonThanks, the patch looks good. I believe it needs to be applied to both D7 and D8. D6 is fine.
Comment #4
webchicknice catch!
Committed and pushed to 7.x and 8.x. Thanks!