From c124c27cdf351638323c2717c4442f902d19464c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Fri, 7 Jan 2022 12:28:34 +0100 Subject: [PATCH] Fix wrong unified search link to folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files/lib/Search/FilesSearchProvider.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php index 2361b8a2d0708..ba2d4bafa3062 100644 --- a/apps/files/lib/Search/FilesSearchProvider.php +++ b/apps/files/lib/Search/FilesSearchProvider.php @@ -118,13 +118,12 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { // Generate thumbnail url $thumbnailUrl = $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->getId()]); $path = $userFolder->getRelativePath($result->getPath()); + + // Use shortened link to centralize the various + // files/folder url redirection in files.View.showFile $link = $this->urlGenerator->linkToRoute( - 'files.view.index', - [ - 'dir' => dirname($path), - 'scrollto' => $result->getName(), - 'openfile' => $result->getId(), - ] + 'files.View.showFile', + ['fileid' => $result->getId()] ); $searchResultEntry = new SearchResultEntry(