I am having an issue enabling admin menu and the toolbar.

On enabling, I get these errors,

Fatal error: Maximum function nesting level of '500' reached, aborting! in /includes/menu.inc on line 622 Call Stack: 0.0011 656504 1. {main}()
/docroot/index.php:0 2.8746 138818744 2. menu_execute_active_handler()
/docroot/index.php:21 3.8733 170061440 3. drupal_deliver_page()
/docroot/includes/menu.inc:531 3.8760 170101048 4. drupal_deliver_html_page()
/docroot/includes/common.inc:2471 3.8761 170102544 5. drupal_render_page()
/docroot/includes/common.inc:2583 4.8530 183770344 6. admin_menu_page_build()
/docroot/includes/common.inc:5616 4.8537 183777272 7. admin_menu_output()
/docroot/sites/all/modules/admin_menu/admin_menu.module:201 4.8541 183778936 8. admin_menu_tree()
/docroot/sites/all/modules/admin_menu/admin_menu.module:479 5.1610 200369480 9. admin_menu_merge_tree()
/docroot/sites/all/modules/admin_menu/admin_menu.inc:45 5.1610 200372552 10. admin_menu_merge_tree()

If I disable the nested call to admin_menu_merge_tree on line 239, the menu loads and it seems like it loads without any issues or missing items.

We have a TON of modules installed which may be an issue. We have never had the menu work in the past, so I haven't used it, but it seems like there is promise if disabling that one nested call allows the menu to load.

Any recommendations on what to try? I'm not really clear on exactly what the function is trying to do other then delve into the menu structure looking for links.

We do have i18n and Globalredirect installed which seem like possible causes for issues.

Thank you.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cobendes’s picture

I have all my administration right taken away. I can not instal a module either update it. it is looping.

damontgomery’s picture

cobendes,

If you don't use drush, you can disable the module by deleting the folder. That may help you in the short term to get back control of your site.

jeeba’s picture

I have the same problem, Im currently debbuging, but I discovered that you can deactivate any module via database. With this code you will see the list of modules SELECT * FROM 'system' WHERE 'type' = 'module' ORDER BY 'system'.'status' DESC

The status in 1 means an active module so you must update the module status field to 0.

Hope this help someone

jeeba’s picture

Issue summary: View changes

removed local path

weseze’s picture

We just experienced this on a project in development. Seems to be related somehow to display suite. The function admin_menu_merge_tree is trying to create links for managing the display of every node type and every ds view mode over and over again. Not sure why this is as we don't have much time to dig deep here.

I created a simple patch that stops the recursion in admin_menu_merge_tree from happening when the parent tree and the "child" item being passed in the recursion are exactly the same.

weseze’s picture

Version: 7.x-3.0-rc3 » 7.x-3.x-dev
weseze’s picture

Priority: Normal » Major

We are finding ourselves having to comment out "admin_menu_merge_tree($item, $tree_dynamic, array($new_expand_map));" completely to prevent these errors...

Reinstalling the site from scratch seems to fix it most of the time. Could this be a weird caching issue?

hyside’s picture

For what it's worth, we have also run into this issue. Admin menu had run fine for us until around two months ago, when we had to disable the module to regain logged in access to the site. None of the modules we had recently introduced appeared to play a role (we disabled them one-by-one and the problem remained, we are not using display suite either).

To add to the confusion, this issue occurs only on our production site (not our dev or training sites that mirror the production DB and files directory nightly), and until today, we were unable to reproduce this issue with a local instance and were unwilling to try out changes on our production site. Today, this issue occurred in a local dev environment, so we were able to try some things to see what would work. The patch in #4 unfortunately didn't help, and like the poster in #6, we had to comment out the call to the admin_menu_merge_tree function to allow us to log in to the site and once again see and use the admin menu.

Chris Charlton’s picture

I'm seeing performance issues with admin_menu_merge_tree() using New Relic.

Chris Charlton’s picture

Priority: Major » Critical
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! :)

wstocker’s picture

Version: 7.x-3.x-dev » 7.x-3.0-rc5
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Active
FileSize
861 bytes

I was experiencing this issue on one or two client sites out of about 50 or so that have this module enabled.

I updated to 7.x-3.x-dev and still experienced the issue, so I rolled back to 7.x-3.0-rc5.

Fixed eventually by switching variables in admin_menu.inc line 190: $expand_map = $current_expand_map;

In the reverse order as they currently are in the module, sites with this issue would experience an infinite loop and eventually exit due to a fatal error.

Patch attached.

truls1502’s picture

Status: Active » Needs review

Great and good job @wweihs.

I have changed the status to Needs Reviews which we need to have someone to take a look at the patch you made. Before we can push it forward to Git, we need a minimum of two RBTC of the Drupal community.

truls1502’s picture

Issue tags: -postponed2w

Status: Needs review » Needs work

The last submitted patch, 11: admin-menu-infinite-loop-1699230.patch, failed testing. View results

truls1502’s picture

Version: 7.x-3.0-rc5 » 7.x-3.x-dev
Status: Needs work » Needs review
FileSize
410 bytes

I have reolled the patch.

Status: Needs review » Needs work

The last submitted patch, 15: admin_menu-1699230-15.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wstocker’s picture

@truls1502 Great!

My team discovered that if the expanded map was empty, we would get empty variable notices logged.
I updated the patch with an empty var check (attached).

Status: Needs review » Needs work

The last submitted patch, 17: admin-menu-infinite-loop-1699230.patch, failed testing. View results

truls1502’s picture

truls1502’s picture

Status: Needs work » Needs review
Chris Matthews’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #19 applied cleanly to 7.x-3.x-dev and after testing fixes this issue for me so I'm changing the status to RTBC. Hopefully this gets committed for the next 7.x release, be it -rc7 or 7.x-3.0.

  • truls1502 committed 17f0627 on 7.x-3.x
    Issue #1699230 by truls1502, wweihs, weseze: Infinite Loop in...
truls1502’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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