Skip to content

Commit

Permalink
Update SearchService.php
Browse files Browse the repository at this point in the history
Typically, when searched for some document with the help of the universal search the document is opened, but not the location.

This PR will allow open files directly from the results of the search.

See nextcloud#249

Signed-off-by: Oleksa <ostasevych@users.noreply.github.com>
  • Loading branch information
ostasevych authored Dec 7, 2023
1 parent 2321c53 commit 09e28b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/SearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ private function setDocumentLinkFile(FilesDocument $document, string $dir, strin
}

$document->setLink(
$this->urlGenerator->linkToRoute('files.view.index', ['dir' => $dir, 'scrollto' => $filename])
$this->urlGenerator->linkToRoute('files.view.index', ['dir' => $this->withoutEndSlash($dir), 'openfile' => $document->getId(), 'scrollto' => $filename])
);
}

Expand Down

0 comments on commit 09e28b7

Please # to comment.