touch() needs to be performed relative to user/files otherwise ownCloud doesn't execute the hooks which means that etags aren't updated properly

This commit is contained in:
Björn Schießle 2013-05-10 12:05:11 +02:00
parent 2e81efc37e
commit cc433d47cb
1 changed files with 4 additions and 1 deletions

View File

@ -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)));