diff options
author | David Rothstein <drothstein@gmail.com> | 2014-05-05 14:40:18 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2014-05-05 14:40:18 -0400 |
commit | ee60a20fc3544497a0f37f9ce3846b2396a84263 (patch) | |
tree | 0bc8096288f2f3fb8263b6bf7932bffc0232c8ab /includes/file.inc | |
parent | b852638c1b31da62f9ab86918ac0c2a8d06af2f4 (diff) | |
download | brdo-ee60a20fc3544497a0f37f9ce3846b2396a84263.tar.gz brdo-ee60a20fc3544497a0f37f9ce3846b2396a84263.tar.bz2 |
Issue #2159549 by Dave Reid: File_save() and file_delete() do not clear entity controller cache.
Diffstat (limited to 'includes/file.inc')
-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; |