diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc --- b/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -208,11 +208,6 @@ * The filename of the requested item or NULL if the item is not found. */ function drupal_get_filename($type, $name, $filename = NULL) { - // Return NULL right away if $type or $name is empty. - if (empty($type) || empty($name)) { - return NULL; - } - // The location of files will not change during the request, so do not use // drupal_static(). static $files = array(); only in patch2: unchanged: --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -157,17 +157,23 @@ public function installDefaultConfig($type, $name) { * {@inheritdoc} */ public function installOptionalConfig(StorageInterface $storage = NULL, $dependency = []) { + $profile = $this->drupalGetProfile(); if (!$storage) { // Search the install profile's optional configuration too. $storage = new ExtensionInstallStorage($this->getActiveStorages(StorageInterface::DEFAULT_COLLECTION), InstallStorage::CONFIG_OPTIONAL_DIRECTORY, StorageInterface::DEFAULT_COLLECTION, TRUE); // The extension install storage ensures that overrides are used. $profile_storage = NULL; } - else { + elseif (isset($profile)) { // Creates a profile storage to search for overrides. - $profile_install_path = $this->drupalGetPath('module', $this->drupalGetProfile()) . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY; + $profile_install_path = $this->drupalGetPath('module', $profile) . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY; $profile_storage = new FileStorage($profile_install_path, StorageInterface::DEFAULT_COLLECTION); } + else { + // Profile has not been set yet. For example during the first steps of the + // installer or during unit tests. + $profile_storage = NULL; + } $collection_info = $this->configManager->getConfigCollectionInfo(); $enabled_extensions = $this->getEnabledExtensions(); only in patch2: unchanged: --- a/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -98,8 +98,11 @@ protected function getAllFolders() { // The install profile can override module default configuration. We do // this by replacing the config file path from the module/theme with the // install profile version if there are any duplicates. - $profile_folders = $this->getComponentNames('profile', array(drupal_get_profile())); - $this->folders = $profile_folders + $this->folders; + $profile = drupal_get_profile(); + if (isset($profile)) { + $profile_folders = $this->getComponentNames('profile', array($profile)); + $this->folders = $profile_folders + $this->folders; + } } } return $this->folders; only in patch2: unchanged: --- a/core/modules/ckeditor/ckeditor.module +++ b/core/modules/ckeditor/ckeditor.module @@ -82,7 +82,7 @@ function _ckeditor_theme_css($theme = NULL) { if (!isset($theme)) { $theme = \Drupal::config('system.theme')->get('default'); } - if ($theme_path = drupal_get_path('theme', $theme)) { + if (isset($theme) && $theme_path = drupal_get_path('theme', $theme)) { $info = system_get_info('theme', $theme); if (isset($info['ckeditor_stylesheets'])) { $css = $info['ckeditor_stylesheets']; only in patch2: unchanged: --- a/core/modules/quickedit/quickedit.module +++ b/core/modules/quickedit/quickedit.module @@ -77,7 +77,7 @@ function quickedit_library_info_alter(&$libraries, $extension) { // First let the base theme modify the library, then the actual theme. $alter_library = function(&$library, $theme) use (&$alter_library) { - if ($theme_path = drupal_get_path('theme', $theme)) { + if (isset($theme) && $theme_path = drupal_get_path('theme', $theme)) { $info = system_get_info('theme', $theme); // Recurse to process base theme(s) first. if (isset($info['base theme'])) {