Skip to content

Commit 367ac46

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
fix: Pass document target through viewer component
Signed-off-by: Julius Knorr <[email protected]> [skip ci]
1 parent 2bb515e commit 367ac46

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/Controller/DocumentController.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,20 @@ public function token(int $fileId, ?string $shareToken = null, ?string $path = n
406406

407407
$this->tokenManager->setGuestName($wopi, $guestName);
408408

409+
$params = [
410+
'urlSrc' => $this->tokenManager->getUrlSrc($file)
411+
];
412+
413+
$targetData = $this->session->get(self::SESSION_FILE_TARGET);
414+
if ($targetData) {
415+
$this->session->remove(self::SESSION_FILE_TARGET);
416+
if ($targetData['fileId'] === $fileId) {
417+
$params['target'] = $targetData['target'];
418+
}
419+
}
420+
409421
return new DataResponse(array_merge(
410-
[ 'urlSrc' => $this->tokenManager->getUrlSrc($file) ],
422+
$params,
411423
$wopi->jsonSerialize(),
412424
));
413425
} catch (Exception $e) {

0 commit comments

Comments
 (0)