From cc433d47cb102d0dca50b925c7519c803ccce48b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Fri, 10 May 2013 12:05:11 +0200 Subject: [PATCH] touch() needs to be performed relative to user/files otherwise ownCloud doesn't execute the hooks which means that etags aren't updated properly --- apps/files_trashbin/lib/trash.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 88c71a75ab..7fda855d0c 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -266,7 +266,10 @@ class Trashbin { // handle the restore result if( $restoreResult ) { - $view->touch($target.$ext, $mtime); + $fakeRoot = $view->getRoot(); + $view->chroot('/'.$user.'/files'); + $view->touch('/'.$location.'/'.$filename.$ext, $mtime); + $view->chroot($fakeRoot); \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('filePath' => \OC\Files\Filesystem::normalizePath('/'.$location.'/'.$filename.$ext), 'trashPath' => \OC\Files\Filesystem::normalizePath($file)));