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.

http://drupal.org/project/menu_node

CommentFileSizeAuthor
#1 1012768-menu-link-delete.patch857 bytesagentrickard
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Status: Active » Needs review
FileSize
857 bytes

And the patch.

agentrickard’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

Moving.

Dave Reid’s picture

Status: Needs review » Reviewed & tested by the community

Generally we invoke hooks before actually deleting, so the testbot and I both approve.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks agentrickard!

aspilicious’s picture

Issue tags: -Needs backport to D7

untagging

Status: Fixed » Closed (fixed)

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