diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/file.inc b/includes/file.inc index ee6ce5181..834699f18 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -621,7 +621,11 @@ function file_save(stdClass $file) { module_invoke_all('entity_update', $file, 'file'); } + // Clear internal properties. unset($file->original); + // Clear the static loading cache. + entity_get_controller('file')->resetCache(array($file->fid)); + return $file; } @@ -1293,6 +1297,7 @@ function file_delete(stdClass $file, $force = FALSE) { if (file_unmanaged_delete($file->uri)) { db_delete('file_managed')->condition('fid', $file->fid)->execute(); db_delete('file_usage')->condition('fid', $file->fid)->execute(); + entity_get_controller('file')->resetCache(); return TRUE; } return FALSE; |