[development] Hook_menu_alter doesn't work if menu item changed
Earnie Boyd
earnie at users.sourceforge.net
Mon Apr 27 16:54:21 UTC 2009
Quoting Earl Miles <merlin at logrus.com>:
> Chris Johnson wrote:
>> I have to agree with Nancy. Re-weighting a menu item does not qualify
>> as customized, IMO. Otherwise, I agree it works as designed.
>
> The thing is, the system can only tell that there's an entry in the
> table, not what part of the item has been modified. I ran into this
> in some completely unrelated piece of code, where I ended up storing
> weights separately so that moving an item up or down didn't
> constitute modifying it, and it is a lot of extra code just to do
> that.
>
So the menu item becomes partially disconnected from the module. This
isn't a good thing. Thanks, Earl, I think you explained something I
noticed with a custom module I'm creating. Drove me nuts until I
directly deleted a menu item that shouldn't exist after the module was
uninstalled. I couldn't delete it via the menu UI at all. The menu
item caused unpredictable actions when the module was reactivated or
the menu cache was rebuilt and I was going bonkers trying to fix a
problem caused by something as simple as changing the item's weight
via the UI.
--
Earnie
-- http://r-feed.com/ -- http://for-my-kids.com/
-- http://www.4offer.biz/ -- http://give-me-an-offer.com/
More information about the development
mailing list