From 256e53ba68caaeb81bcfd5fd8e4c3944cc3c23ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Tue, 14 May 2013 11:34:40 +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; backport of https://github.com/owncloud/core/pull/3303 --- .gitignore | 1 + apps/files_trashbin/lib/trash.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 40d6e6ca0fe..4daa37abf2c 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,4 @@ data-autotest /tests/coverage* /tests/autoconfig* /tests/autotest* +/l10n/.tx/ \ No newline at end of file diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index f0b56eef014..c1837e0deee 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -158,7 +158,10 @@ class Trashbin { $ext = self::getUniqueExtension($location, $filename, $view); $mtime = $view->filemtime($source); if( $view->rename($source, $target.$ext) ) { - $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))); -- 2.39.5