Fetch attachment folder for the correct user during cron job
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
backportbot-nextcloud[bot]
parent
4cd4707559
commit
82515e5731
@@ -192,11 +192,11 @@ class ConfigService {
|
||||
return array_filter($groups);
|
||||
}
|
||||
|
||||
public function getAttachmentFolder(): string {
|
||||
public function getAttachmentFolder(string $userId = null): string {
|
||||
if ($this->getUserId() === null) {
|
||||
throw new NoPermissionException('Must be logged in get the attachment folder');
|
||||
}
|
||||
|
||||
return $this->config->getUserValue($this->getUserId(), 'deck', 'attachment_folder', '/Deck');
|
||||
return $this->config->getUserValue($userId ?? $this->getUserId(), 'deck', 'attachment_folder', '/Deck');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class Listener {
|
||||
}
|
||||
}
|
||||
|
||||
$parent = $this->configService->getAttachmentFolder();
|
||||
$parent = $this->configService->getAttachmentFolder($userId);
|
||||
$event->setParent($parent);
|
||||
if (!$event->getView()->is_dir($parent)) {
|
||||
$event->getView()->mkdir($parent);
|
||||
|
||||
Reference in New Issue
Block a user