summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-10 12:05:11 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-10 12:05:11 +0200
commitcc433d47cb102d0dca50b925c7519c803ccce48b (patch)
treee9c54e3e94d12d01d3c5ae3a343fd0c642b88fe8 /apps/files_trashbin
parent2e81efc37eeb95b7e5d392349ad393bb94d6928a (diff)
downloadnextcloud-server-cc433d47cb102d0dca50b925c7519c803ccce48b.tar.gz
nextcloud-server-cc433d47cb102d0dca50b925c7519c803ccce48b.zip
touch() needs to be performed relative to user/files otherwise ownCloud doesn't execute the hooks which means that etags aren't updated properly
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/trash.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 88c71a75ab0..7fda855d0c2 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)));