The ecommerce address module has a bug in address_menu which causes the following odd behavior:

1. The "my address book" menu item does not appear in the administer -> menus listing.
2. The "my address book" menu item appears on every other page (where the user has permission to access it) and as a result of 1. cannot be disabled.

The attached patch fixes this bug (a one-byte change: if(!$may_cache) becomes if($may_cache)), and removes some nearby sloppy code (another one-liner: just removed $GLOBALS['user']->uid == $user->uid).

CommentFileSizeAuthor
address-menu-fix.patch716 byteskrumms

Comments

krumms’s picture

Hmm this problem is a little thornier than I anticipated. The above patch will only fix the issue for the user who makes the change (usually the administrator).

The real problem is that this menu item cannot be a MENU_NORMAL_ITEM or a MENU_SUGGESTED_ITEM, because the fact a menu item is enabled or disabled seems to be determined by it's path - as such, we really need to use MENU_DYNAMIC_ITEM. However, this leaves us with the issue that we can't disable the menu item (which is what I'm trying to do).

For now I've just commented the menu item out of my local branch of the source. Somebody with a bit more Drupal experience may be able to offer more insight into how/if this issue can be resolved.

matt westgate’s picture

I cleaned up the address module menu system a bit, but I'm marking this as 'by design' since there currently isn't a clean way around this issue.