Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the code:
/**
* Implementation of hook_enable().
*/
function admin_enable() {
$result = db_query("SELECT * FROM {menu_links} WHERE link_path LIKE 'admin%'");
while ($item = db_fetch_array($result)) {
_menu_delete_item($item, TRUE);
}
menu_rebuild();
// Weight admin to come after other modules -- in particular, admin_theme().
db_query("UPDATE {system} SET weight = 1 WHERE name = 'admin' AND type = 'module'");
}
Delete all menu links that begin with admin/*. This is crazy!. If you have added items to the menu such navigation. This module deleted all my admin links without my consent. I think this can not be so without asking.
Comments
Comment #1
trunks CreditAttribution: trunks commentedThat's really, really dangerous. I had a database backup just a few minutes before enabling this module, thanks $deity. That sql query should only filter menu_links from module_name, insted of link_path (at least, although I think to remove menu entries on enabling a module is quite dangerous).
Comment #2
_vid CreditAttribution: _vid commentedDuplicate issue. See http://drupal.org/node/611254 Deletes any custom menu links that start with admin
Comment #2.0
_vid CreditAttribution: _vid commentedChange description