mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix files_version hooks
This commit is contained in:
parent
7207211f3a
commit
929b8c3e69
1 changed files with 17 additions and 17 deletions
|
|
@ -39,15 +39,15 @@ class Hooks {
|
|||
* cleanup the versions directory if the actual file gets deleted
|
||||
*/
|
||||
public static function remove_hook($params) {
|
||||
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
|
||||
|
||||
$versions = new Storage( new \OC_FilesystemView('') );
|
||||
|
||||
$path = $params[\OC_Filesystem::signal_param_path];
|
||||
|
||||
if($path<>'') $versions->delete( $path );
|
||||
|
||||
}
|
||||
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
|
||||
|
||||
$versions = new Storage( new \OC_FilesystemView('') );
|
||||
|
||||
$path = $params[\OC\Files\Filesystem::signal_param_path];
|
||||
|
||||
if($path<>'') $versions->delete( $path );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -58,15 +58,15 @@ class Hooks {
|
|||
* of the stored versions along the actual file
|
||||
*/
|
||||
public static function rename_hook($params) {
|
||||
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
|
||||
|
||||
$versions = new Storage( new \OC_FilesystemView('') );
|
||||
|
||||
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
|
||||
|
||||
$versions = new Storage( new \OC_FilesystemView('') );
|
||||
|
||||
$oldpath = $params['oldpath'];
|
||||
$newpath = $params['newpath'];
|
||||
|
||||
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
|
||||
|
||||
$newpath = $params['newpath'];
|
||||
|
||||
if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue