Upgrading old Drupal, Part 2: Show module names which causes Drupal update failed, and resolve it.

I was upgrading an old drupal 6 site to drupal 7.
Lots of modules and themes need to be upgraded at the same time. Some are easy, but some not when it comes to dependency issues.
I keep getting Some of the pending updates cannot be applied because their dependencies were not met. error when running Database update. OK I know there's some problems with module, but which module(s)?

This is a follow-up of Upgrading old Drupal, Part 1: No content shown, unable to login, missing modules, and resolve it.

1. Modify update.php, a dirty hack and quick workaround

Go to /usr/share/drupal7, make a backup of update.php.
Start editing update.php

Firstly we need to add a variable to store module names. At line 62 we add a $bad_module = ''; so it become to:

$incompatible_updates_exist = FALSE;
$bad_module = '';
foreach ($updates as $module => $update) {

At line 73 we store the problematic module's name after $incompatible_updates_exist = TRUE;, code is $bad_module = $bad_module. ' & ' . $module;

      $incompatible_updates_exist = TRUE;
      $bad_module = $bad_module. ' & ' . $module;
      continue;    

At line 110 we need to show the names after error message. Code became this:

      if ($incompatible_updates_exist) {
        drupal_set_message('Some of the pending updates cannot be applied because their dependencies were not met. Bad modules: '.$bad_module, 'warning');
      }

The diff update.php update.php.backup result should be something like this:

root@Ammon:/usr/share/drupal7# diff update.php update.php.bkup 
62d61
<   $bad_module = '';
73d71
<       $bad_module = $bad_module. ' & ' . $module;
110c108
<     drupal_set_message('Some of the pending updates cannot be applied because their dependencies were not met. Bad modules: '.$bad_module, 'warning');
---
>     drupal_set_message('Some of the pending updates cannot be applied because their dependencies were not met.', 'warning');

2. Run update.php again

Go to http://YOU_DOMAIN_NAME/update.php to find the module names.

3. Remove bad modules

Remove these modules from /etc/drupal/7/sites/all/modules/ and run update.php again.

4. Login and enjoy!

Login with http://YOU_DOMAIN_NAME/user/login or http://YOU_DOMAIN_NAME/?q=user/login Your loved site should be now ready for you.

Hope this HOWTO can save a tree and a kitten.

Comments

slots for real money gsn casino games free online casino slots slots for real money | https://onlinecasinoplay777.us.org/ - casino games https://onlinecasinoplay777.us.org/ - casino blackjack

slots for real money best online casinos casino blackjack slots for real money - https://onlinecasinoplay.us.org/ - play casino - https://onlinecasinoplay.us.org/ - online casinos for us players

online casinos for us players casino bonus bovada casino online casino slots | https://onlinecasinoslotsmaxx.com/ - gsn casino https://onlinecasinoslotsmaxx.com/ - online casino

gsn casino games online casino real money free online casino slots best online casinos | https://online-casinos.us.org/ - best online casinos https://online-casinos.us.org/ - betfair online casino

best online casinos real money casino free online casino slots casino real money | https://onlinecasinoplay.us.org/ - real money casino https://onlinecasinoplay.us.org/ - online gambling

bovada casino casino play online gambling casino casino real money | https://onlinecasinoplay.us.org/ - online gambling https://onlinecasinoplay.us.org/ - online casino slots

play casino bovada casino online casino bonus online casino games | https://onlinecasinoslotsmaxx.com/ - online casinos for us players https://onlinecasinoslotsmaxx.com/ - casino real money

online casino real money gsn casino best online casinos play casino | https://onlinecasino2018.us.org/ - casino play https://onlinecasino2018.us.org/ - bovada casino

online gambling casino online casinos online casino gambling real money casino | https://onlinecasinoplay.us.org/ - online casino gambling https://onlinecasinoplay.us.org/ - free online casino slots

slots for real money betfair online casino casino blackjack casino bonus | https://onlinecasino2018.us.org/ - bovada casino https://onlinecasino2018.us.org/ - online casinos for us players

free online casino slots online casino casino real money gsn casino | https://onlinecasino2018.us.org/ - real money casino https://onlinecasino2018.us.org/ - bovada casino

free online casino slots slots for real money betfair online casino online casino games | https://onlinecasinoslotsmaxx.com/ - casino slots https://onlinecasinoslotsmaxx.com/ - bovada casino

online casino gambling best online casinos best online casino casino games | https://onlinecasinoslotsmaxx.com/ - casino play https://onlinecasinoslotsmaxx.com/ - casino games

online casino gambling casino blackjack slots for real money casino play | https://onlinecasino2018.us.org/ - casino games https://onlinecasino2018.us.org/ - mgm online casino

casino games bovada casino online gambling casino online casino gambling | https://onlinecasino2018.us.org/ - gsn casino slots https://onlinecasino2018.us.org/ - best online casinos

play casino online casinos casino real money casino real money | https://onlinecasinoslotsmaxx.com/ - online casino real money https://onlinecasinoslotsmaxx.com/ - mgm online casino

slots for real money casino real money online casinos casino real money | https://onlinecasinoslotsmaxx.com/ - online casino real money https://onlinecasinoslotsmaxx.com/ - play casino

online casino bonus casino slots play casino casino bonus | https://onlinecasinoslotsmaxx.com/ - online casino gambling https://onlinecasinoslotsmaxx.com/ - mgm online casino

casino bonus online casino slots free online casino slots casino blackjack | https://onlinecasinoslotsmaxx.com/ - best online casinos https://onlinecasinoslotsmaxx.com/ - best online casinos

casino bonus online casino bonus online casinos for us players | https://onlinecasino2018.us.org/ - online gambling

online casinos for us players online casino slots play casino | https://onlinecasino2018.us.org/ - casino play

casino real money online gambling gsn casino games | https://onlinecasino2018.us.org/ - casino real money

real money casino casino slots online casino slots best online casino | https://onlinecasinoslotsmaxx.com/ - casino online https://onlinecasinoslotsmaxx.com/ - online casino gambling

online casino real money casino real money gsn casino games | https://onlinecasino2018.us.org/ - online casino slots

online casino real money slots for real money online casino gambling online casinos | https://onlinecasinoslotsmaxx.com/ - mgm online casino https://onlinecasinoslotsmaxx.com/ - free online casino slots

online gambling best online casino free online casino slots casino real money | https://onlinecasinoslotsmaxx.com/ - online casino bonus https://onlinecasinoslotsmaxx.com/ - free online casino slots

best online casinos casino games online gambling casino | https://onlinecasino2018.us.org/ - online gambling casino

Pages

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.