3

I am on Drupal 7. I was on a hosting company that would give me only 64MB of PHP Memory. That led to several issues when installing new modules. My website would run short of memory and would brake right after installing the module. But when reloading the modules page, the module would prove to be installed and working. I confess I kept on playing with fire until I finally broke the installation of one of my modules. It was Menu Blocks. The module would appear as installed, but clicking on the Configuration link on the Modules page would lead me to the wrong page. I couldn't reach the module configuration page. To make a long story short: the installation failed.

I swiched to a new host with more memory and now I am OK. But I still can't install Menu Blocks. I have tried disabling it and reenabling... Nothing. Still not working. Then I disabled AND uninstalled it. Then reinstalled. Nothing happens, still the wrong behavior for the module configuration page. What do I need to do to really and completely uninstall any problematic traces it could have left on my Drupal install? Completely delete Menu Block's tables on the database in case they still exist in there? If I completely remove those tables, do I risk breaking up my website? Completely deleting the Menu Block package, then restarting? I thought this wouldn't solve the problem... Any help appreciated, thank you!

1

Menu blocks doesn't alter the DB at all during the installation. It uses the 'block' and 'block_role' tables from drupal core and creates several entries in the 'variable' table to store some config.

So here's what I would do:

  • Check admin/reports/dblog
  • Install the website locally with wamp or Acquia DEV Desktop (using the import tab and backup migrate module) if you're on windows to do some debugging.
  • Check the 'menu_block_admin_settings_form' function in menu_block.admin.inc which is called when going to admin/config/user-interface/menu-block
0

Follow below steps to cleanup menu blocks installation.

  1. Disable the module.
  2. Uninstall the module.
  3. Clear All Drupal Cache Tables.
  4. Install the module.
  5. Again clear all drupal cache tables.
  6. Try the link "admin/structure/block/add-menu-block"

Still if it doesn't work then you need to debug the module is correctly un-installed or not by checking following uninstall conditions are met or not by inspecting database.

  // Delete menu block variables.
  foreach (variable_get('menu_block_ids', array()) AS $delta) {
    variable_del("menu_block_{$delta}_title_link");
    variable_del("menu_block_{$delta}_admin_title");
    variable_del("menu_block_{$delta}_parent");
    variable_del("menu_block_{$delta}_level");
    variable_del("menu_block_{$delta}_follow");
    variable_del("menu_block_{$delta}_depth");
    variable_del("menu_block_{$delta}_expanded");
    variable_del("menu_block_{$delta}_sort");
  }
  variable_del('menu_block_ids');
  variable_del('menu_block_suppress_core');
  variable_del('menu_block_menu_order');
  // Remove block configurations.
  db_delete('block')
    ->condition('module', 'menu_block')
    ->execute();
  db_delete('block_role')
    ->condition('module', 'menu_block')
    ->execute();
  cache_clear_all();
  • I am sorry for the long delay answering this... Still nothing! The variables hadn't even been added to the Variable table. I have also checked the Block and Block_role tables. They have no entries related to menu_block (they couldn't, anyway, since the "Add menu block" hadn't even been added to the Blocks area, I could never add a menu block). I am kind of lost here. I have cleaned cache several times, installed, uninstalled, even deleted and downloaded the module again... Nothing will solve the problem. Any ideas for a further look? Where could I investigate? Thank you! – Marcos Buarque Oct 9 '12 at 13:44
0

You can try using drush, which is much easier to re-install failed module.

For instance using Devel module:

drush -y dre foo

Disable, Uninstall, and Install a list of projects.


or using the standard way:

drush -y dis foo && drush -y pm-uninstall foo && drush -y en foo

Then clear you caches (drush -y cc all).

See also: How to detect modules enabled incorrectly?


Alternatively you may try to force the installation process again, for instance:

  1. Edit foo.install and add foo_install(); at the end to run the function manually.
  2. Run the file in drush via: drush scr foo.install as standalone file.
  3. If installation is completed, remove added foo_install();.

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.