diff --git a/core/UPGRADE.txt b/core/UPGRADE.txt index f035b6c..579f904 100644 --- a/core/UPGRADE.txt +++ b/core/UPGRADE.txt @@ -203,7 +203,10 @@ following the instructions in the INTRODUCTION section at the top of this file: sites/default/settings.php -14. Run update.php by visiting http://www.example.com/core/update.php (replace +14. If your files directory is not in sites/default/files, read + https://drupal.org/upgrade/file_public_path + +15. Run update.php by visiting http://www.example.com/core/update.php (replace www.example.com with your domain name). This will update the core database tables. @@ -220,17 +223,17 @@ following the instructions in the INTRODUCTION section at the top of this file: - Once the upgrade is done, $settings['update_free_access'] must be reverted to FALSE. -15. Backup your database after the core upgrade has run. +16. Backup your database after the core upgrade has run. -16. Replace and update your non-core modules and themes, following the +17. Replace and update your non-core modules and themes, following the procedures at http://drupal.org/node/948216 -17. Go to Administration > Reports > Status report. Verify that everything is +18. Go to Administration > Reports > Status report. Verify that everything is working as expected. -18. Ensure that $settings['update_free_access'] is FALSE in settings.php. +19. Ensure that $settings['update_free_access'] is FALSE in settings.php. -19. Go to Administration > Configuration > Development > Maintenance mode. +20. Go to Administration > Configuration > Development > Maintenance mode. Disable the "Put site into maintenance mode" checkbox and save the configuration. diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 69faba0..1ea6a67 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -430,7 +430,7 @@ function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) { if (!empty($config_directories[$type])) { // Allow a configuration directory path to be outside of webroot. if (empty($config_directories[$type]['absolute'])) { - $path = conf_path() . '/files/' . $config_directories[$type]['path']; + $path = settings()->get('file_public_path', conf_path() . '/files') . '/' . $config_directories[$type]['path']; } else { $path = $config_directories[$type]['path']; diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 91925e1..8c5611d 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -923,6 +923,8 @@ protected function prepareEnvironment() { file_prepare_directory($this->private_files_directory, FILE_CREATE_DIRECTORY); file_prepare_directory($this->temp_files_directory, FILE_CREATE_DIRECTORY); file_prepare_directory($this->translation_files_directory, FILE_CREATE_DIRECTORY); + $this->settingsSet('file_public_path', $this->public_files_directory); + $this->generatedTestFiles = FALSE; // Create and set new configuration directories. @@ -972,14 +974,14 @@ protected function prepareConfigDirectories() { include_once DRUPAL_ROOT . '/core/includes/install.inc'; foreach (array(CONFIG_ACTIVE_DIRECTORY, CONFIG_STAGING_DIRECTORY) as $type) { // Assign the relative path to the global variable. - $path = 'simpletest/' . substr($this->databasePrefix, 10) . '/config_' . $type; + $path = 'config_' . $type; $GLOBALS['config_directories'][$type]['path'] = $path; // Ensure the directory can be created and is writeable. if (!install_ensure_config_directory($type)) { return FALSE; } // Provide the already resolved path for tests. - $this->configDirectories[$type] = $this->originalFileDirectory . '/' . $path; + $this->configDirectories[$type] = $this->public_files_directory . '/' . $path; } } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 7b9302a..7d212cb 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -780,7 +780,6 @@ protected function setUp() { NestedArray::setValue($GLOBALS['conf'], array_merge(array($config_base), explode('.', $name)), $value); } } - $this->settingsSet('file_public_path', $this->public_files_directory); // Execute the non-interactive installer. require_once DRUPAL_ROOT . '/core/includes/install.core.inc'; $this->settingsSet('cache', array('default' => 'cache.backend.memory')); diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalNoConfigUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalNoConfigUpgradePathTest.php index 00feb89..856c3fc 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalNoConfigUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalNoConfigUpgradePathTest.php @@ -27,6 +27,10 @@ public function setUp() { parent::setUp(); // Override $conf_path and $config_directories in settings.php. + $settings['settings']['file_public_path'] = (object) array( + 'value' => $this->public_files_directory, + 'required' => TRUE, + ); $settings['conf_path'] = (object) array( 'value' => $this->public_files_directory, 'required' => TRUE, @@ -45,22 +49,8 @@ protected function refreshVariables() { // Refresh the variables only if the site was already upgraded. if ($this->upgradedSite) { // update.php puts the new, randomized config directries in this file. + global $config_directories; include $this->public_files_directory . '/settings.php'; - $GLOBALS['config_directories'] = array(); - foreach ($config_directories as $type => $data) { - // update.php runs as the child site, so writes the paths relative to - // that "$conf_path/files", but here, we're running as the parent site, - // so need to make the paths relative to our "conf_path()/files". - // - // Example: - // - Parent site conf_path(): 'sites/default' - // - Child site $conf_path: 'sites/default/files/simpletest/123456' - // - Child site $data['path']: 'config_xyz' - // - Desired result: 'simpletest/123456/files/config_xyz' - // - // @see config_get_config_directory() - $GLOBALS['config_directories'][$type]['path'] = substr($conf_path, strlen(conf_path() . '/files/')) . '/files/' . $data['path']; - } parent::refreshVariables(); } } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 7777e0c..76be315 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2243,15 +2243,6 @@ function system_update_8059() { } /** - * Move the file_public_path variable to settings. - */ -function system_upgrade_8060() { - if ($path = update_variable_get('file_public_path')) { - drupal_rewrite_settings(array('settings' => array('file_public_path' => $path))); - } -} - -/** * Add route_parameters column to the menu_links table. */ function system_update_8060() {