diff options
author | Georg Ehrke <developer@georgehrke.com> | 2015-03-23 01:05:33 +0100 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2015-09-20 11:22:40 +0200 |
commit | b3ff773bbf363e4d7d44d7c6ce7ae2eec8250cfb (patch) | |
tree | b9434a7bb309a6ddae54a32a5db580cc523117a6 /lib | |
parent | bbd1e996050fee80795d0e656da98b6451232c6c (diff) | |
download | nextcloud-server-b3ff773bbf363e4d7d44d7c6ce7ae2eec8250cfb.tar.gz nextcloud-server-b3ff773bbf363e4d7d44d7c6ce7ae2eec8250cfb.zip |
delete cached preview when rolling back file's version
add random number using OC.parseQueryString and _.extend()
version rollback: add missing prefix to OC\Preview::post_delete
add test to assure that the rollback hook is called
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/private/preview.php | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php index f5ba05ded74..acb9814dd76 100644 --- a/lib/base.php +++ b/lib/base.php @@ -803,8 +803,9 @@ class OC { OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete'); OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete'); OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files'); - OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete'); + OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete_versions'); OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete'); + OC_Hook::connect('\OCP\Versions', 'rollback', 'OC\Preview', 'post_delete_versions'); } /** diff --git a/lib/private/preview.php b/lib/private/preview.php index db2a56f9fa5..f2ff40c51f7 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -1302,6 +1302,13 @@ class Preview { /** * @param array $args + */ + public static function post_delete_versions($args) { + self::post_delete($args, 'files/'); + } + + /** + * @param array $args * @param string $prefix */ public static function post_delete($args, $prefix = '') { |