The XML sitemap module adds a fieldset to the menu link item form to set an individual menu links as excluded or included. The good ol' menu_link_save() function has this fun tidbit that prevents hook_menu_link_item_update() from firing:

  if (!$existing_item || (array_intersect_assoc($item, $existing_item)) != $existing_item) {
    // Perform db merge and stuff ...

    // Notify modules we have acted on a menu item.
    $hook = 'menu_link_insert';
    if ($existing_item) {
      $hook = 'menu_link_update';
    }

    // Perform other stuff
  }

So if an end-user just changes the XML sitemap settings, since the values get skipped when using array_intersect_assoc(), the section is skipped.

Comments

lucascaro’s picture

I think this may have been fixed already. Is it still an issue?

The line has been changed to:

if (!$existing_item || (array_intersect_key($item, $existing_item)) != $existing_item) {

and the logic has been reworked.

dave reid’s picture

Issue summary: View changes

No, this is still not resolved. Even with the changes to menu_link_save() the hooks are not getting executed.

BrendanSmith’s picture

Hi,

I'm still having issues invoking hook_menu_link_update in version 7.32, Is their a work around until this issue has been resolved?

EDIT: I was mistaken, the hook is only invoked when every value in $existing_item is not the same in menu_link_save()

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.