I have a Drupal 8 installation that went bad after installing admin_menu module. and now the website is down with this error.

stderr: PHP Fatal error: Call to undefined function user_access() in /var/www/clients/client1/web7/web/modules/admin_menu/admin_menu.module on line 149

I've tried to delete the admin_menu module with Drush, given website is completely out of order and it gives me this error.

PHP Fatal error: Call to undefined function variable_del() in /var/www/clients/client1/web7/web/modules/admin_menu/admin_menu.install on line 22
Drush command terminated abnormally due to an unrecoverable error.
Error: Call to undefined function variable_del() in /var/www/clients/client1/web7/web/modules/admin_menu/admin_menu.install, line 22

So I've looked into admin_menu.install and I have commented out its code.

function admin_menu_uninstall() {
  // Delete variables.
/*  variable_del('admin_menu_components');
  // Unused variables still should be deleted.

It appears it was also done in a patch here.

Since it worked, I put the module back on and tried to overcome the issue and deleted content of admin_menu_page_bottom() function at line 150 in admin_menu.module and this brought the website back online.

  • Is it okay to remove this function content? and why is this module still not functional? have anyone else managed to get this working on Drupal?
  • Is it okay to do this in Drupal 8 to unsintall admin_menu removal with above procedure and is there anything that I am missing?
  • I am not sure why admin menu isn't working but I do know many are now using drupal.org/project/admin_toolbar and drupal.org/project/toolbar_themes in 8 instead. Same functionality and it builds on core toolbar. – Nigel Waters Jul 1 '17 at 17:18
  • 1
    This module is super old (last release March 2015) long before Drupal 8.0.0 was released and stable. It could just be a port that was started and never finished. That said, hardly anyone uses this module anymore - they use Admin Toolbar. – Kevin Jul 1 '17 at 17:40

Admin menu hasn't had any development effort for comfortably more than 2 years now. It doesn't have a Drupal 8 release to speak of; the chances of getting the module working without major surgery to the code are pretty slim.

If you can get the module successfully uninstalled by commenting out some code, then definitely do it (then probably delete the module folder so you don't accidentally enable it again).

The Admin Toolbar module is its successor. It integrates with the core toolbar, and has a sub-module which provides the tools menu that you'll be familiar with from Drupal 7 (with clear cache links etc).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.