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();

Comments

legolasbo’s picture

Status: Active » Needs review
StatusFileSize
new1.23 KB

Besides 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.

Johnny vd Laar’s picture

Thank you, I've committed your fix (slightly changed) here:
http://drupalcode.org/project/nodeblock.git/commitdiff/b3bdee9?hp=6c286f...

Johnny vd Laar’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.