fix missing dir creation for file versions (OC_Filesystemview::mkdir doesn't work here because it doesn't create directories recursively)
This commit is contained in:
parent
7b64ab9294
commit
33dcb3b1f4
|
@ -64,7 +64,7 @@ class Hooks {
|
||||||
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
|
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
|
||||||
if(Storage::isversioned($rel_oldpath)) {
|
if(Storage::isversioned($rel_oldpath)) {
|
||||||
$info=pathinfo($abs_newpath);
|
$info=pathinfo($abs_newpath);
|
||||||
if(!file_exists($info['dirname'])) mkdir($info['dirname'],0700,true);
|
if(!file_exists($info['dirname'])) mkdir($info['dirname'],0750,true);
|
||||||
$versions = Storage::getVersions($rel_oldpath);
|
$versions = Storage::getVersions($rel_oldpath);
|
||||||
foreach ($versions as $v) {
|
foreach ($versions as $v) {
|
||||||
rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
|
rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
|
||||||
|
|
|
@ -106,9 +106,9 @@ class Storage {
|
||||||
|
|
||||||
|
|
||||||
// create all parent folders
|
// create all parent folders
|
||||||
$dirname = dirname($filename);
|
$info=pathinfo($filename);
|
||||||
if(!$users_view->file_exists('/files_versions/'.$dirname)) {
|
if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
|
||||||
$users_view->mkdir('/files_versions/'.$dirname,0700,true);
|
mkdir($versionsFolderName.'/'.$info['dirname'],0750,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// store a new version of a file
|
// store a new version of a file
|
||||||
|
|
Loading…
Reference in New Issue