summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/simpletest/tests/upgrade/drupal-6.filled.database.php10
-rw-r--r--modules/simpletest/tests/upgrade/upgrade.upload.test9
-rw-r--r--modules/system/system.install11
3 files changed, 28 insertions, 2 deletions
diff --git a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
index 9f33ee0a7..25092e70f 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
@@ -19735,7 +19735,15 @@ db_insert('variable')->fields(array(
))
->values(array(
'name' => 'file_directory_temp',
- 'value' => 's:26:"/Applications/MAMP/tmp/php";',
+ 'value' => 's:29:"/drupal-6/file/directory/temp";',
+))
+->values(array(
+ 'name' => 'file_directory_path',
+ 'value' => 's:29:"/drupal-6/file/directory/path";',
+))
+->values(array(
+ 'name' => 'file_downloads',
+ 'value' => 'i:2;',
))
->values(array(
'name' => 'filter_html_1',
diff --git a/modules/simpletest/tests/upgrade/upgrade.upload.test b/modules/simpletest/tests/upgrade/upgrade.upload.test
index 761d6558d..a0402a38e 100644
--- a/modules/simpletest/tests/upgrade/upgrade.upload.test
+++ b/modules/simpletest/tests/upgrade/upgrade.upload.test
@@ -65,5 +65,14 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase {
}
$this->assertIdentical($filenames, $recorded_filenames, 'The uploaded files are present in the same order after the upgrade.');
}
+ // Make sure the file settings were properly migrated.
+ $d6_file_directory_temp = '/drupal-6/file/directory/temp';
+ $d6_file_directory_path = '/drupal-6/file/directory/path';
+ $d6_file_downloads = 2; // FILE_DOWNLOADS_PRIVATE
+
+ $this->assertNull(variable_get('file_directory_temp', NULL), "The 'file_directory_temp' variable was properly removed.");
+ $this->assertEqual(variable_get('file_temporary_path', 'drupal-7-bogus'), $d6_file_directory_temp, "The 'file_temporary_path' setting was properly migrated.");
+ $this->assertEqual(variable_get('file_default_scheme', 'drupal-7-bogus'), 'private', "The 'file_default_scheme' setting was properly migrated.");
+ $this->assertEqual(variable_get('file_private_path', 'drupal-7-bogus'), $d6_file_directory_path, "The 'file_private_path' setting was properly migrated.");
}
}
diff --git a/modules/system/system.install b/modules/system/system.install
index ad76e11be..5e0d5b8d2 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2157,7 +2157,7 @@ function system_update_7033() {
}
/**
- * Migrate the file_downloads setting and create the new {file_managed} table.
+ * Migrate the file path settings and create the new {file_managed} table.
*/
function system_update_7034() {
$files_directory = variable_get('file_directory_path', NULL);
@@ -2918,6 +2918,15 @@ function system_update_7065() {
}
/**
+ * Migrate the 'file_directory_temp' variable.
+ */
+function system_update_7066() {
+ $d6_file_directory_temp = variable_get('file_directory_temp', file_directory_temp());
+ variable_set('file_temporary_path', $d6_file_directory_temp);
+ variable_del('file_directory_temp');
+}
+
+/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
*/