Skip to content
Snippets Groups Projects
Unverified Commit 92b8a5ef authored by Arthur Schiwon's avatar Arthur Schiwon Committed by GitHub
Browse files

Merge pull request #37057 from nextcloud/backport/36904/stable26

[stable26] fix(files): Fix controller setup for guests
parents 72cf710e 442bce3e
Branches
Tags
No related merge requests found
......@@ -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]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment