Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions lib/private/Files/Node/HookConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,36 @@ private function getNodeForPath(string $path, bool $isDir = false): Node {
$info = null;
}
if ($isDir || Filesystem::is_dir($path)) {
return new NonExistingFolder($this->root, $this->view, $fullPath, $info);
$node = new NonExistingFolder($this->root, $this->view, $fullPath, $info);
} else {
return new NonExistingFile($this->root, $this->view, $fullPath, $info);
$node = new NonExistingFile($this->root, $this->view, $fullPath, $info);
}
}
if ($info->getType() === FileInfo::TYPE_FILE) {
return new File($this->root, $this->view, $info->getPath(), $info);
} else {
return new Folder($this->root, $this->view, $info->getPath(), $info);
if ($info->getType() === FileInfo::TYPE_FILE) {
$node = new File($this->root, $this->view, $info->getPath(), $info);
} else {
$node = new Folder($this->root, $this->view, $info->getPath(), $info);
}
}
if ($node->getPath() === null) {
$e = new \Exception("null path when trying to get node for hook");
$data = [
'exception' => $e,
'original_path' => $path,
'view_root' => Filesystem::getView()->getRoot(),
];
if ($info) {
$data = $data + [
'mount_point' => $info->getMountPoint()->getMountPoint(),
'mount_provider_class' => $info->getMountPoint()->getMountProvider(),
'storage' => $info->getStorage()->getId(),
'file_id' => $info->getId(),
];
} else {
$data['info'] = 'not-found';
}
$this->logger->error($e->getMessage(), $data);
}
return $node;
}
}
Loading