Skip to content

Commit 2f26926

Browse files
authored
Merge pull request #177 from nextcloud/backport/175/stable27
[stable27] fix: do not use removed View::getLocalFolder()
2 parents 2abdb89 + 88783fd commit 2f26926

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)