diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 6c69150..04dd0a4 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -889,14 +889,13 @@ function drupal_get_filename($type, $name, $filename = NULL) { // Profiles are a special case: they have a fixed location and naming. if ($type == 'profile') { - $profile_filename = "profiles/$name/$name.profile"; - $files[$type][$name] = file_exists($profile_filename) ? $profile_filename : FALSE; + $files[$type][$name] = "profiles/$name/$name.profile"; } if (!isset($files[$type])) { $files[$type] = array(); } - if (!empty($filename) && file_exists($filename)) { + if (!empty($filename)) { $files[$type][$name] = $filename; } elseif (isset($files[$type][$name])) { @@ -909,10 +908,7 @@ function drupal_get_filename($type, $name, $filename = NULL) { else { try { if (function_exists('db_query')) { - $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField(); - if (file_exists(DRUPAL_ROOT . '/' . $file)) { - $files[$type][$name] = $file; - } + $files[$type][$name] = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField(); } } catch (Exception $e) { diff --git a/core/includes/update.inc b/core/includes/update.inc index 1de14f0..b2287d9 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -91,6 +91,13 @@ function update_prepare_d8_bootstrap() { // drupal_get_installed_schema_version(). $system_schema = drupal_get_installed_schema_version('system'); if ($system_schema < 8000) { + + // We need to rescan the modules so their actual place on the file system + // is updated. see http://drupal.org/node/752730. + include_once DRUPAL_ROOT . '/core/includes/module.inc'; + include_once DRUPAL_ROOT . '/core/modules/system/system.module'; + system_rebuild_module_data(); + $has_required_schema = $system_schema >= REQUIRED_D7_SCHEMA_VERSION; $requirements = array( 'drupal 7 version' => array( @@ -184,7 +191,8 @@ function update_module_add_to_system($modules = array()) { ); foreach ($modules as $module) { $module_info = drupal_parse_info_file('core/modules/' . $module . '/' . $module . '.info'); - db_insert('system') + db_merge('system') + ->key(array('name'), array($module)) ->fields(array( 'filename' => 'core/modules/' . $module . '/' . $module . '.module', 'name' => $module, diff --git a/core/update.php b/core/update.php index dd338a2..47ba960 100644 --- a/core/update.php +++ b/core/update.php @@ -283,10 +283,10 @@ function update_access_allowed() { if (!empty($update_free_access)) { return TRUE; } - // Calls to user_access() might fail during the Drupal 6 to 7 update process, + // Calls to user_access() might fail during the Drupal 7 to 8 update process, // so we fall back on requiring that the user be logged in as user #1. try { - require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module'; + require_once DRUPAL_ROOT . '/core/modules/user/user.module'; return user_access('administer software updates'); } catch (Exception $e) {