diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-10 17:30:15 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-10 17:30:15 +0000 |
commit | bdb7e56143d52bb8528042591f0e8df9afde45db (patch) | |
tree | 6801086da136619cdecfe34a94d482118f5fe4e7 /includes | |
parent | e892ed5c317f7d37da09a2ad3a0e113703437b10 (diff) | |
download | brdo-bdb7e56143d52bb8528042591f0e8df9afde45db.tar.gz brdo-bdb7e56143d52bb8528042591f0e8df9afde45db.tar.bz2 |
- Patch #741578 by nikgregory, andypost, Berdir, noahb: 'File' is a reserved word that should not be used.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 17 | ||||
-rw-r--r-- | includes/form.inc | 4 | ||||
-rw-r--r-- | includes/menu.inc | 8 |
3 files changed, 15 insertions, 14 deletions
diff --git a/includes/file.inc b/includes/file.inc index baa0a9473..96da7ad4e 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -509,13 +509,13 @@ function file_save(stdClass $file) { $file->filesize = filesize($file->uri); if (empty($file->fid)) { - drupal_write_record('file', $file); + drupal_write_record('file_managed', $file); // Inform modules about the newly added file. module_invoke_all('file_insert', $file); entity_invoke('insert', 'file', $file); } else { - drupal_write_record('file', $file, 'fid'); + drupal_write_record('file_managed', $file, 'fid'); // Inform modules that the file has been updated. module_invoke_all('file_update', $file); entity_invoke('update', 'file', $file); @@ -974,7 +974,7 @@ function file_delete(stdClass $file, $force = FALSE) { // Make sure the file is deleted before removing its row from the // database, so UIs can still find the file in the database. if (file_unmanaged_delete($file->uri)) { - db_delete('file')->condition('fid', $file->fid)->execute(); + db_delete('file_managed')->condition('fid', $file->fid)->execute(); return TRUE; } return FALSE; @@ -1069,7 +1069,7 @@ function file_unmanaged_delete_recursive($path) { * An integer containing the number of bytes used. */ function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) { - $query = db_select('file', 'f'); + $query = db_select('file_managed', 'f'); // Use separate placeholders for the status to avoid a bug in some versions // of PHP. See http://drupal.org/node/352956. $query->where('f.status & :status1 = :status2', array(':status1' => $status, ':status2' => $status)); @@ -1083,9 +1083,9 @@ function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) { /** * Saves a file upload to a new location. * - * The file will be added to the {file} table as a temporary file. Temporary - * files are periodically cleaned. To make the file a permanent file, assign - * the status and use file_save() to save the changes. + * The file will be added to the {file_managed} table as a temporary file. + * Temporary files are periodically cleaned. To make the file a permanent file, + * assign the status and use file_save() to save the changes. * * @param $source * A string specifying the filepath or URI of the uploaded file to save. @@ -1504,7 +1504,8 @@ function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAM * Save a string to the specified destination without invoking file API. * * This function is identical to file_save_data() except the file will not be - * saved to the {file} table and none of the file_* hooks will be called. + * saved to the {file_managed} table and none of the file_* hooks will be + * called. * * @param $data * A string containing the contents of the file. diff --git a/includes/form.inc b/includes/form.inc index 3fe577a77..9518ef13a 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -197,8 +197,8 @@ function drupal_build_form($form_id, &$form_state) { // $menu_get_item() is not available at installation time. if (!isset($form_state['build_info']['file']) && !defined('MAINTENANCE_MODE')) { $item = menu_get_item(); - if (!empty($item['file'])) { - $form_state['build_info']['file'] = $item['file']; + if (!empty($item['include_file'])) { + $form_state['build_info']['file'] = $item['include_file']; } } diff --git a/includes/menu.inc b/includes/menu.inc index 5ce50daee..048980d03 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -463,8 +463,8 @@ function menu_execute_active_handler($path = NULL, $deliver = TRUE) { // to make alterations just for this request. drupal_alter('menu_active_handler', $router_item, $path); if ($router_item['access']) { - if ($router_item['file']) { - require_once DRUPAL_ROOT . '/' . $router_item['file']; + if ($router_item['include_file']) { + require_once DRUPAL_ROOT . '/' . $router_item['include_file']; } $page_callback_result = call_user_func_array($router_item['page_callback'], $router_item['page_arguments']); } @@ -3271,7 +3271,7 @@ function _menu_router_save($menu, $masks) { 'description', 'position', 'weight', - 'file', + 'include_file', )); $num_records = 0; @@ -3302,7 +3302,7 @@ function _menu_router_save($menu, $masks) { 'description' => $item['description'], 'position' => $item['position'], 'weight' => $item['weight'], - 'file' => $item['include file'], + 'include_file' => $item['include file'], )); // Execute in batches to avoid the memory overhead of all of those records |