I love this module. I have it on every site i have ever done since Drupal 4.7. Other than the odd issue a few years back with the poorly parented Views menu items in the Structure menu; i have never had issues. But, as luck would have it; i have taken over a project which sadly is a mess of the work of at least 5 other devs. One of the more annoying issues with the site is that the admin menu is messed up. Not only does it have the old Views menu items out of place, but i actually have items missing as well. And now, trying to fix this by resetting 1 of the missing items, clearing cache, etc... i now have managed to get the entire Structure menu disappearing. Truly the menu from hell.

I disabled and uninstalled the module, deleted module folder and added lastest dev. Nothing helps. I assume this is more an issue with internal menu structure than with admin menu; but hoping some way to rebuild whatever it is that is messed up and get this working.

Comments

liquidcms created an issue. See original summary.

liquidcms’s picture

Title: Why is my admin menu so messed up? » Admin Menu needs a rebuild feature.
Category: Support request » Feature request

omg!! and after months of putting up with this mess.. and finally posting a case about it.. 5 mins later its fixed.. lol

solution:

so frustrated with the admin menu and unable to work with the Structure menu missing i resorted to trying the Admin module; which i have seen many times before but never liked it as much as Admin Menu. I could see with Admin that Structure menu was still a little wonky; even though it did show up with Admin. But.. i did see that Admin module has a rebuild function. figured it couldnt hurt. Sure enough it fixes everything... Views items, missing menu items for other modules, missing Structure menu.. everything. And not just within Admin but with Admin Menu as well.

So, i'll change this to a feature request; Admin Menu should have whatever Admin module has to do a rebuild.

RedEight’s picture

Are you referring to the "Wipe and rebuild" button that Admin provides? As far as I can tell, it completely wipes the management menu and then triggers the menu rebuild.

from the Admin module file admin.admin.inc line 193

/**
 * Wipe and rebuild the admin menu.
 */
function admin_settings_rebuild_submit($form, &$form_state) {
  db_delete('menu_links')
    ->condition('menu_name', 'management')
    ->execute();
  menu_rebuild();
  if (module_exists('block')) {
    cache_clear_all('admin', 'cache_block', TRUE);
  }
}

Is the issue that the menu_rebuild() function isn't actually updating those poorly parented menu items and leaving them in their "weird" state. Obviously the code inside that function can be ran using drush or devel's run php code option if you don't want to install Admin. I've had the weird views menu items sitting at the top of my Structure dropdown for months and it's driving me crazy.

e.ryan.schmidt@gmail.com’s picture

Yes! I've been dealing with a similar issue on three of my multisites, and it's been driving me INSANE having a bunch of un-nested admin menu items. Installed Admin and ran a rebuild and it's good as new with zero effort. Thank you so much for pointing this out, liquidcms!

liquidcms’s picture

@redeight, the code you posted above does the trick. thanks.

donapis’s picture

Hi all,

How to use code #3?

veroniqueg’s picture

Thanks it did it for me too

@donapis
il you have the devel module, go to your_site/devel/php
paste the code and execute

donapis’s picture

@veroniqueg
I rarely use the devel module, but i'll give it a try. Thanks for the input.

truls1502’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +postponed2w

I am sorry for no reply until now.

There are many issues regarding this module admin_menu which is a bit difficult for us to follow up since some of the issues might be already outdated, or is already fixed by the module or any other modules or itself core which means that the problem might no longer need to be fixed.

We can see that the issue has been created for a few years ago, I hope it is okay for you that I am postponing the issue, and give you around two weeks. If you still face the problem, could you tell us the step by step when until you get the error message or what is frustrated you, and a list of modules you are using related to admin_menu and a screenshot that might help us? So it makes us easier to reproduce your issue.

However, after two weeks with no feedback - we will close this issue. So in case, you noticed it after the issue is closed, do not hesitate to reopen it like and fill information which is mentioned above.

So before giving us a feedback, do you mind to test it again with our latest 7.x-3.x-dev?

Thank you for understanding! :)

liquidcms’s picture

Sadly issues can no longer be re-opened.

This was simply a feature request. I am not sure if the underlying issue still exists; but i suspect it does. This request was simply to add the function to reset the menu (using code posted in #3 above) to one of the admin menu's tasks.

I should have posted a patch. Pretty easy to implement this. I blame that it is such a rare occasion to require this; i just never got around to it.

truls1502’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: -postponed2w

Hey, @liquidcms!

Sure, we can re-open it at no problem. :)

It has been a challenge for us to keep all the old issues even before we joined to try to help to maintain the module. Therefore, I am trying to clean the issues and see which issues are still needed and priority of the Drupal community today. You are one of under ten people who responded the hundreds of issues which is up to eight years old.

So, you can just ignore the automatic message I posted earlier and let us see how we can fix it. :)

Alain DG’s picture

subscribe :)

dark_kz’s picture

#3 worked. Thank you!
I just enabled Devel module and go to "Execute PHP Code" devel/php
and pasted the code below without "<? php ?>" tags:

  db_delete('menu_links')
    ->condition('menu_name', 'management')
    ->execute();
  menu_rebuild();
  if (module_exists('block')) {
    cache_clear_all('admin', 'cache_block', TRUE);
  }