If I set a custom machine name for the nodeblock it does not get deleted when the node gets deleted. This is due to node delete hook not taking into account the machine name. It tries to delete the block by the default delta (nid) eg:
db_delete('block')
->condition('module', 'nodeblock')
->condition('delta', $node->nid)
->execute();
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nodeblock-block-not-deleted-if-custom-machine-name-2051267-1.patch | 1.23 KB | legolasbo |
Comments
Comment #1
legolasboBesides the original bug posted above I found a second bug. The block configuration entry would get deleted in block_role, but not in block_node_type which would leave stale data in the database.
Attached patch fixes both bugs.
Comment #2
Johnny vd Laar commentedThank you, I've committed your fix (slightly changed) here:
http://drupalcode.org/project/nodeblock.git/commitdiff/b3bdee9?hp=6c286f...
Comment #3
Johnny vd Laar commented