diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-02-24 15:43:14 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-03-01 20:57:01 +0100 |
commit | f0e50bcb741ac83b3bc91fbe52248736be33d71c (patch) | |
tree | 9ca0285bbccdc07486680d75e66cc77aeef410d9 /apps | |
parent | e5162fb9afa422cc00c872dac34245cefb7141da (diff) | |
download | nextcloud-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.php | 9 |
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 ''; } |