summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-02-24 15:43:14 +0100
committerJulius Härtl <jus@bitgrid.net>2019-03-01 20:57:01 +0100
commitf0e50bcb741ac83b3bc91fbe52248736be33d71c (patch)
tree9ca0285bbccdc07486680d75e66cc77aeef410d9 /apps
parente5162fb9afa422cc00c872dac34245cefb7141da (diff)
downloadnextcloud-server-f0e50bcb741ac83b3bc91fbe52248736be33d71c.tar.gz
nextcloud-server-f0e50bcb741ac83b3bc91fbe52248736be33d71c.zip
Fetch node and filename also if access cache was used
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/lib/Collaboration/Resources/ResourceProvider.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files/lib/Collaboration/Resources/ResourceProvider.php b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
index 4609eda451f..d29b18afea3 100644
--- a/apps/files/lib/Collaboration/Resources/ResourceProvider.php
+++ b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
@@ -52,6 +52,11 @@ class ResourceProvider implements IProvider {
if (isset($this->nodes[(int) $resource->getId()])) {
return $this->nodes[(int) $resource->getId()];
}
+ $nodes = $this->rootFolder->getById((int) $resource->getId());
+ if (!empty($nodes)) {
+ $this->nodes[(int) $resource->getId()] = array_shift($nodes);
+ return $this->nodes[(int) $resource->getId()];
+ }
return null;
}
@@ -66,6 +71,10 @@ class ResourceProvider implements IProvider {
if (isset($this->nodes[(int) $resource->getId()])) {
return $this->nodes[(int) $resource->getId()]->getPath();
}
+ $node = $this->getNode($resource);
+ if ($node) {
+ return $node->getName();
+ }
return '';
}