This is a possible API error, since items that want to act on menu link deletion may need to run queries against that row.
Note that node_delete() runs its hooks before issueing the final db_delete() statement.
Compare:
http://api.drupal.org/api/drupal/includes--menu.inc/function/_menu_delet...
http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...
To replicate:
-- Install Drupal core, enable tests.
-- Install Menu Node module HEAD. Run tests for that module.
-- Apply patch.
-- Run Menu Node tests again.
I can work around this, by attaching the $item passed to the hook to the node, however, I think the API call stack is out of order and can be corrected.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1012768-menu-link-delete.patch | 857 bytes | agentrickard |
Comments
Comment #1
agentrickardAnd the patch.
Comment #2
agentrickardMoving.
Comment #3
Dave ReidGenerally we invoke hooks before actually deleting, so the testbot and I both approve.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x. Thanks agentrickard!
Comment #5
aspilicious CreditAttribution: aspilicious commenteduntagging