aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-03-09 17:30:42 +0100
committerGitHub <noreply@github.com>2023-03-09 17:30:42 +0100
commit92b8a5ef1e8f40ffd1fb6320d54926f94b17239d (patch)
tree947c1c083fa77edc16bd3be9ae6696cb96777b45
parent72cf710ec8993863db5b8d36f4afe29728e674a6 (diff)
parent442bce3e0b00fb7134d7c5b931c1a78501620655 (diff)
downloadnextcloud-server-92b8a5ef1e8f40ffd1fb6320d54926f94b17239d.tar.gz
nextcloud-server-92b8a5ef1e8f40ffd1fb6320d54926f94b17239d.zip
Merge pull request #37057 from nextcloud/backport/36904/stable26
[stable26] fix(files): Fix controller setup for guests
-rw-r--r--apps/files/lib/Service/TagService.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/apps/files/lib/Service/TagService.php b/apps/files/lib/Service/TagService.php
index 29b6fbc2840..0ea60ec09d8 100644
--- a/apps/files/lib/Service/TagService.php
+++ b/apps/files/lib/Service/TagService.php
@@ -42,24 +42,17 @@ class TagService {
private $userSession;
/** @var IManager */
private $activityManager;
- /** @var ITags */
+ /** @var ITags|null */
private $tagger;
/** @var Folder */
private $homeFolder;
/** @var EventDispatcherInterface */
private $dispatcher;
- /**
- * @param IUserSession $userSession
- * @param IManager $activityManager
- * @param ITags $tagger
- * @param Folder $homeFolder
- * @param EventDispatcherInterface $dispatcher
- */
public function __construct(
IUserSession $userSession,
IManager $activityManager,
- ITags $tagger,
+ ?ITags $tagger,
Folder $homeFolder,
EventDispatcherInterface $dispatcher
) {
@@ -81,6 +74,10 @@ class TagService {
* @throws \OCP\Files\NotFoundException if the file does not exist
*/
public function updateFileTags($path, $tags) {
+ if ($this->tagger === null) {
+ throw new \RuntimeException('No tagger set');
+ }
+
$fileId = $this->homeFolder->get($path)->getId();
$currentTags = $this->tagger->getTagsForObjects([$fileId]);