diff options
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 2 | ||||
-rw-r--r-- | modules/system/system.install | 23 | ||||
-rw-r--r-- | modules/system/system.module | 4 | ||||
-rw-r--r-- | modules/system/system.test | 6 |
4 files changed, 21 insertions, 14 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index b188e871b..fff543ad4 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1783,7 +1783,7 @@ function hook_file_download($uri) { if (!file_prepare_directory($uri)) { $uri = FALSE; } - $result = db_query("SELECT f.* FROM {file} f INNER JOIN {upload} u ON f.fid = u.fid WHERE uri = :uri", array('uri' => $uri)); + $result = db_query("SELECT f.* FROM {file_managed} f INNER JOIN {upload} u ON f.fid = u.fid WHERE uri = :uri", array('uri' => $uri)); foreach ($result as $file) { if (!user_access('view uploaded files')) { return -1; diff --git a/modules/system/system.install b/modules/system/system.install index 48db779e9..a442b2f6a 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -692,7 +692,7 @@ function system_schema() { 'primary key' => array('type', 'language'), ); - $schema['file'] = array( + $schema['file_managed'] = array( 'description' => 'Stores information for uploaded files.', 'fields' => array( 'fid' => array( @@ -983,10 +983,10 @@ function system_schema() { 'not null' => TRUE, 'default' => 0, ), - 'file' => array( + 'include_file' => array( 'description' => 'The file to include for this element, usually the page callback function lives in this file.', 'type' => 'text', - 'size' => 'medium' + 'size' => 'medium', ), ), 'indexes' => array( @@ -2094,7 +2094,7 @@ function system_update_7033() { } /** - * Migrate the file_downloads setting and create the new {file} table. + * Migrate the file_downloads setting and create the new {file_managed} table. */ function system_update_7034() { $files_directory = variable_get('file_directory_path', NULL); @@ -2112,7 +2112,7 @@ function system_update_7034() { } variable_del('file_downloads'); - $schema['file'] = array( + $schema['file_managed'] = array( 'description' => 'Stores information for uploaded files.', 'fields' => array( 'fid' => array( @@ -2181,11 +2181,11 @@ function system_update_7034() { 'primary key' => array('fid'), ); - db_create_table('file', $schema['file']); + db_create_table('file_managed', $schema['file_managed']); } /** - * Migrate upload module files to the new {file} table. + * Migrate upload module files to the new {file_managed} table. */ function system_update_7035() { if (!db_table_exists('upload')) { @@ -2205,7 +2205,7 @@ function system_update_7035() { foreach ($result as $file) { $file['uri'] = $scheme . str_replace($basename, '', $file['uri']); $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']); - db_insert('file')->fields($file)->execute(); + db_insert('file_managed')->fields($file)->execute(); $fids[] = $file['fid']; } // TODO: delete the found fids from {files}? @@ -2391,6 +2391,13 @@ function system_update_7051() { } /** + * Rename file to include_file in {menu_router} table. + */ +function system_update_7052() { + db_change_field('menu_router', 'file', 'include_file', array('type' => 'text', 'size' => 'medium')); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ diff --git a/modules/system/system.module b/modules/system/system.module index f2f06bfe7..6badde7c2 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -260,7 +260,7 @@ function system_entity_info() { return array( 'file' => array( 'label' => t('File'), - 'base table' => 'file', + 'base table' => 'file_managed', 'entity keys' => array( 'id' => 'fid', ), @@ -2782,7 +2782,7 @@ function system_cron() { // Remove temporary files that are older than DRUPAL_MAXIMUM_TEMP_FILE_AGE. // Use separate placeholders for the status to avoid a bug in some versions // of PHP. See http://drupal.org/node/352956. - $result = db_query('SELECT fid FROM {file} WHERE status & :permanent1 <> :permanent2 AND timestamp < :timestamp', array( + $result = db_query('SELECT fid FROM {file_managed} WHERE status & :permanent1 <> :permanent2 AND timestamp < :timestamp', array( ':permanent1' => FILE_STATUS_PERMANENT, ':permanent2' => FILE_STATUS_PERMANENT, ':timestamp' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE diff --git a/modules/system/system.test b/modules/system/system.test index a18112230..dd7b44699 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -469,7 +469,7 @@ class CronRunTestCase extends DrupalWebTestCase { function testTempFileCleanup() { // Temporary file that is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE. $temp_old = file_save_data(''); - db_update('file') + db_update('file_managed') ->fields(array( 'status' => 0, 'timestamp' => 1, @@ -480,7 +480,7 @@ class CronRunTestCase extends DrupalWebTestCase { // Temporary file that is less than DRUPAL_MAXIMUM_TEMP_FILE_AGE. $temp_new = file_save_data(''); - db_update('file') + db_update('file_managed') ->fields(array('status' => 0)) ->condition('fid', $temp_new->fid) ->execute(); @@ -488,7 +488,7 @@ class CronRunTestCase extends DrupalWebTestCase { // Permanent file that is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE. $perm_old = file_save_data(''); - db_update('file') + db_update('file_managed') ->fields(array('timestamp' => 1)) ->condition('fid', $temp_old->fid) ->execute(); |