diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index dd67fa8..a0610ba 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -843,8 +843,9 @@ function drupal_get_filename($type, $name, $filename = NULL) { // drupal_static(). static $files = array(), $dirs = array(); - // Profiles are converted into modules elsewhere. + // Profiles are converted into modules in system_rebuild_module_data(). // @todo Remove false-exposure of profiles as modules. + $original_type = $type; if ($type == 'profile') { $type = 'module'; } @@ -866,7 +867,7 @@ function drupal_get_filename($type, $name, $filename = NULL) { 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)) { + if ($file && file_exists(DRUPAL_ROOT . '/' . $file)) { $files[$type][$name] = $file; } } @@ -888,6 +889,12 @@ function drupal_get_filename($type, $name, $filename = NULL) { elseif ($type == 'theme') { $extension = 'info'; } + // Profiles are converted into modules in system_rebuild_module_data(). + // @todo Remove false-exposure of profiles as modules. + elseif ($original_type == 'profile') { + $dir = 'profiles'; + $extension = 'profile'; + } else { $extension = $type; } diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index ef84e44..d7fed29 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1103,7 +1103,7 @@ function install_find_profiles() { $profiles = &drupal_static(__FUNCTION__); if (!isset($profiles)) { - $profiles = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.profile$/', 'profiles', 'name', 0); + $profiles = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.profile$/', 'profiles'); } return $profiles; } diff --git a/core/includes/install.inc b/core/includes/install.inc index 20627de..0b5fa2d 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -798,7 +798,9 @@ function install_profile_info($profile, $langcode = 'en') { 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, ); - $info = drupal_parse_info_file(drupal_get_path('profile', $profile) . "/$profile.info") + $defaults; + $profile_file = drupal_get_path('profile', $profile) . "/$profile.info"; + $info = drupal_parse_info_file($profile_file); + $info += $defaults; $info['dependencies'] = array_unique(array_merge( drupal_required_modules(), $info['dependencies'],