Skip to content

Commit

Permalink
Merge pull request #1278 from nextcloud/bugfix/noid/empty-remote
Browse files Browse the repository at this point in the history
  • Loading branch information
juliushaertl committed Dec 3, 2020
2 parents bea5976 + 4c31101 commit 523210e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public function getCapabilities() {
$collaboraCapabilities = $this->capabilitiesService->getCapabilities();
$this->capabilities = [
'richdocuments' => [
'version' => \OC::$server->getAppManager()->getAppVersion('richdocuments'),
'mimetypes' => self::MIMETYPES,
'mimetypesNoDefaultOpen' => self::MIMETYPES_OPTIONAL,
'collabora' => $collaboraCapabilities,
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function open($fileId) {
'&richdocuments_remote_access=' . $remote;

$event = new BeforeFederationRedirectEvent(
$item, $relative, $remote
$item, $relativeFolderPath, $remote
);
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->dispatch(BeforeFederationRedirectEvent::class, $event);
Expand Down
2 changes: 2 additions & 0 deletions lib/Db/WopiMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public function generateFileToken($fileId, $owner, $editor, $version, $updatable
'direct' => $direct,
'isRemoteToken' => $isRemoteToken,
'templateId' => $templateId,
'remoteServer' => '',
'remoteServerToken' => '',
'share' => $share
]);

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/FederationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function getRemoteRedirectURL(File $item, $direct = null) {
} else {
$wopi = $this->tokenManager->getRemoteTokenFromDirect($item, $direct->getUid());
}
$url = $remote . 'index.php/apps/richdocuments/remote?shareToken=' . $item->getStorage()->getToken() .
$url = rtrim($remote, '') . '/index.php/apps/richdocuments/remote?shareToken=' . $item->getStorage()->getToken() .
'&remoteServer=' . $wopi->getServerHost() .
'&remoteServerToken=' . $wopi->getToken();
if ($item->getInternalPath() !== '') {
Expand Down

0 comments on commit 523210e

Please sign in to comment.