The uninstall system currently uninstall the module, then pulls and removes the menu items. This works fine in situations where the menu system is static, however, in situations where the menu system is dictated via a database query (such as in views), invoking the database uninstall before pulling the menu causes errors to be thrown and menu items to not be correctly cleared from the system. By simply reversing the logic (first, pull the menu, then uninstall the module), things behave correctly and all menu items are correctly deleted.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

patch code looks good, applies cleanly

pwolanin’s picture

Status: Needs review » Reviewed & tested by the community

tested with poll module, and uninstall works fine with this change (no logical reason why it wouldn't).

chx’s picture

Yes this is a fine change.

Senpai’s picture

Title: Uninstall system » Uninstall system does not correctly remove dynamic menu items when a module is deleted
FileSize
973 bytes

Tested against HEAD using Devel and Devel Generate. All install/uninstall features still work as intended. I added a couple of one-liner comments to help out anyone staring at this function in the future. Send this baby on down the road!

Gábor Hojtsy’s picture

Version: 6.x-dev » 7.x-dev

Committed to 6.x. RTBC for 7.x. Thanks Senpai for your code comments!

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

spiffyd’s picture

My STATIC menu items also experience this problem... they don't get cleared after uninstall. Any suggestions on what I can do?! I am using 6.4.