Skip to content

fix: Redirect to the file's actual drive location instead of the personal drive - EXO-90214 - #2090

Merged
AzmiTouil merged 1 commit into
feature/maintenancefrom
fix/exo-90214-document-location-redirect
Sep 23, 2026
Merged

AzmiTouil merged 1 commit into
feature/maintenancefrom
fix/exo-90214-document-location-redirect

Conversation

@AzmiTouil

Copy link
Copy Markdown
Contributor

Fixes the redirect reported in EXO-90214

Repro: open My Workspace > Drive, browse into a space via "Lecteurs d'espace", open an ONLYOFFICE document, click "Go to Document" (top right) — lands on the personal Documents treeview instead of the file's actual space location.

Root cause: DocumentsFileNameCell.openInEditMode() / openInReadOnlyMode() build the editor's backTo param as the raw window.location.pathname, duplicating (and diverging from) the drive-aware logic that $documentsUtils.getEditorUrl(file, mode) already implements correctly elsewhere in this app (DocumentsMain.vue, FileSearchCard.vue, activity attachments…). "My Workspace > Drive" browses into a space's drive as a pure client-side SPA — the URL never leaves /portal/dw/documents, even while viewing a space's files — so the raw-pathname shortcut always points back to the personal drive regardless of where the opened file actually lives.

Fix: replace the duplicated URL construction with the existing $documentsUtils.getEditorUrl(file, mode) helper, matching the pattern already used everywhere else file-open actions are wired.

Verified live against a real file (/Groups/spaces/test_space_perf_1/Documents/...) browsed from "My Workspace > Drive > Lecteurs d'espace": old code computed backTo=/portal/dw/documents (the bug, reproduced exactly); the fix computes backTo=/portal/g/:spaces:test_space_perf_1/documents (correct). Full-repo sweep confirms no other occurrence of the same raw-pathname pattern.

Classification: N3 (frontend-only, no REST/DAO/schema/ACL surface).

@github-actions github-actions Bot added the partialCIBuild Perform Partial CI Build label Sep 23, 2026
@AzmiTouil
AzmiTouil force-pushed the fix/exo-90214-document-location-redirect branch from 5e04354 to 1bea215 Compare September 23, 2026 10:22
@AzmiTouil
AzmiTouil changed the base branch from develop to feature/maintenance September 23, 2026 10:22
@AzmiTouil
AzmiTouil requested a review from ahamdi September 23, 2026 10:22
@github-actions github-actions Bot removed the partialCIBuild Perform Partial CI Build label Sep 23, 2026
@AzmiTouil
AzmiTouil merged commit e2dc570 into feature/maintenance Sep 23, 2026
6 of 7 checks passed
@AzmiTouil
AzmiTouil deleted the fix/exo-90214-document-location-redirect branch September 23, 2026 12:59
AzmiTouil added a commit that referenced this pull request Sep 25, 2026
…user home page - EXO-90214 (#2092)

* fix: Redirect to the file's actual drive location instead of the personal drive - EXO-90214 (#2090)

Fixes the redirect reported in EXO-90214
Repro: open My Workspace > Drive, browse into a space via "Lecteurs d'espace", open an ONLYOFFICE document, click "Go to Document" (top right) — lands on the personal Documents treeview instead of the file's actual space location.

Root cause: DocumentsFileNameCell.openInEditMode() / openInReadOnlyMode() build the editor's backTo param as the raw window.location.pathname, duplicating (and diverging from) the drive-aware logic that $documentsUtils.getEditorUrl(file, mode) already implements correctly elsewhere in this app (DocumentsMain.vue, FileSearchCard.vue, activity attachments…). "My Workspace > Drive" browses into a space's drive as a pure client-side SPA — the URL never leaves /portal/dw/documents, even while viewing a space's files — so the raw-pathname shortcut always points back to the personal drive regardless of where the opened file actually lives.

Fix: replace the duplicated URL construction with the existing $documentsUtils.getEditorUrl(file, mode) helper, matching the pattern already used everywhere else file-open actions are wired.

Verified live against a real file (/Groups/spaces/test_space_perf_1/Documents/...) browsed from "My Workspace > Drive > Lecteurs d'espace": old code computed backTo=/portal/dw/documents (the bug, reproduced exactly); the fix computes backTo=/portal/g/:spaces:test_space_perf_1/documents (correct). Full-repo sweep confirms no other occurrence of the same raw-pathname pattern.

Classification: N3 (frontend-only, no REST/DAO/schema/ACL surface).
(cherry picked from commit e2dc570)

* fix: Resolve the personal drive page from the current drive, not the user home page - EXO-90214 (#2091)

The personal branch of getParentFolderUrl, and the two sibling
constructions in DocumentInfoDrawer, built the drive URL as
eXo.env.portal.defaultPath + /dashboard/drive. defaultPath is the
user's home page (UserPortalConfigService.getUserHomePage), so a user
whose home is People was sent to /portal/dw/people/dashboard/drive/...
after "Go to documents" in the ONLYOFFICE editor.

getPersonalDriveUrl() replaces the three constructions: the current
pathname truncated at /Private when inside the personal drive, the
current pathname when the Documents application is on the page, and
the addon's own global SYSTEM node /portal/<metaPortal>/documents
otherwise, the same target DocumentPermanentLinkPlugin and
NotificationUtils use. A file at the drive root points at the drive
page itself.

No query string is added to backTo: EditorPortlet passes it through
HTMLSanitizer.sanitize, which encodes "=" as "&#61;". The folder still
opens because initSettings forces the folder view on the personal
drive before getDocumentDataFromUrl reads the path.

(cherry picked from commit 4bae48e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants