Skip to content

Commit b6bf6ae

Browse files
committed
fix: do not use removed View::getLocalFolder()
Actually without replacement. Prior to NC 27 it was implemented on local storage only, trying to run it would have led into an Exception – if folders were not filtered out here already. Since the method would actually only make sense for external folders, removing it seems to be the reasonable decision, and actually does not remove functionality. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent f27b77d commit b6bf6ae

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Operation.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
use OCP\BackgroundJob\IJobList;
3737
use OCP\EventDispatcher\Event;
3838
use OCP\EventDispatcher\GenericEvent;
39-
use OCP\Files\Folder;
39+
use OCP\Files\File as FileNode;
4040
use OCP\Files\InvalidPathException;
4141
use OCP\Files\IRootFolder;
4242
use OCP\Files\Node;
@@ -145,7 +145,7 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch
145145

146146
// '', admin, 'files', 'path/to/file.txt'
147147
[, , $folder,] = explode('/', $node->getPath(), 4);
148-
if ($folder !== 'files' || $node instanceof Folder) {
148+
if ($folder !== 'files' || !($node instanceof FileNode)) {
149149
return;
150150
}
151151

@@ -196,9 +196,7 @@ protected function buildCommand(string $template, Node $node, string $event, arr
196196
if (strpos($command, '%f')) {
197197
try {
198198
$view = new View();
199-
if ($node instanceof Folder) {
200-
$fullPath = $view->getLocalFolder($node->getPath());
201-
} else {
199+
if ($node instanceof FileNode) {
202200
$fullPath = $view->getLocalFile($node->getPath());
203201
}
204202
if ($fullPath === null) {

0 commit comments

Comments
 (0)