Undefined index: distribution_name when upgrading Drupal 6 to Drupal 7

Wow, its been a while since I lasted posted.

Over the last year and a half I have been upgrading a lot of Drupal 6 sites to Drupal 7.  I have found many times that different sites like to throw different errors (or sometimes now errors) after upgrading.  I have been plagued by one specific error on a number of sites.

Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 207 of /var/www/drupal/includes/install.inc).

Alas, after a year of searching, I finally found the solution at Drupal.org .  Apparently what happens in the upgrade, sometimes, is that all of the installation profiles in Drupal are disabled.  Why?  I have no idea.  If you were to look in install.inc, you would see the following code.

<?php
$profile = drupal_get_profile();
$info = system_get_info('module', $profile);
return $info['distribution_name'];
?>

So with the profiles disabled, ‘distribution_name’ doesn’t exist.  So what do you need to do?  Well enable a profile of course!  Only one problem, there is no way in Drupal to enable a profile without getting in to the database.  To fix this, you will need access to mysql or phpmyadmin and you’ll want to run the following SQL command

UPDATE system SET status=1 WHERE name='standard';

This will reactivate the Standard profile in Drupal and your distribution_name error should disappear.

This entry was posted in Drupal, Site Development, Technology. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.