Skip to content

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

Merged
AzmiTouil merged 1 commit into
feature/maintenancefrom
fix/exo-90214-personal-drive-location
Sep 24, 2026
Merged

AzmiTouil merged 1 commit into
feature/maintenancefrom
fix/exo-90214-personal-drive-location

Conversation

@AzmiTouil

@AzmiTouil AzmiTouil commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up of #2090 for EXO-90214 — personal documents case

From My Workspace > Drive, opening a personal ONLYOFFICE document and clicking "Go to documents" redirected to /portal/<user-home-page>/dashboard/drive/Private/Documents (for example /portal/dw/people/dashboard/drive/... when the home page is People) instead of /portal/myworkspace/dashboard/drive/Private/Documents.

Root cause. getParentFolderUrl (personal branch) and the two sibling constructions in DocumentInfoDrawer.vue built the drive URL as eXo.env.portal.defaultPath + /dashboard/drive. defaultPath is the user's home page (UIPortalApplication.gtmpl -> UserPortalConfigService.getUserHomePage(userName)), not the My Workspace site. Introduced by EXO-86459 (#1966).

Fix. One helper, getPersonalDriveUrl() in DocumentsUtils.js, replaces the three constructions:

  • inside the personal drive (pathname contains /Private): the pathname truncated there — back to the drive page the user came from;
  • on a page hosting the Documents application in personal context: the current pathname (drive root);
  • anywhere else (activity stream, search, space pages): the addon's own global SYSTEM node /portal/<metaPortal>/documents, the same target DocumentPermanentLinkPlugin and NotificationUtils use server-side;
  • a file at the drive root points at the drive page itself, no /Private suffix.

Not done, on purpose: no ?view=folder in backTo. EditorPortlet passes backTo through HTMLSanitizer.sanitize, which encodes = as &#61; (executed against the 7.3 bundle jars). The folder still opens: initSettings forces the folder view on the personal drive before getDocumentDataFromUrl reads the path. The final URL is therefore .../dashboard/drive/Private/Documents?updated=true.

Verification. Throwaway Node harness (not committed, per the frontend testing norm) over 9 scenarios — My Workspace drive root and sub-folders, global documents page, dw activity stream, space page, file at Private root, folder directly under Private, space file via space drives: all pass on the fix; 8 of 9 fail on the current code (the space-file case is unchanged). ESLint clean on the added lines.

Classification: N3 — frontend only, no REST/DAO/schema/ACL surface.

Knowledge: none — two facts worth a domains/documents.md §14 entry (defaultPath is the user home page; backTo cannot carry a query string) to be proposed as a corpus PR separately.

🤖 Generated with Claude Code

…user home page - EXO-90214

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.
@github-actions github-actions Bot added the partialCIBuild Perform Partial CI Build label Sep 24, 2026
@AzmiTouil
AzmiTouil requested a review from ahamdi September 24, 2026 10:18
@AzmiTouil
AzmiTouil merged commit 4bae48e into feature/maintenance Sep 24, 2026
8 of 9 checks passed
@AzmiTouil
AzmiTouil deleted the fix/exo-90214-personal-drive-location branch September 24, 2026 14:02
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

partialCIBuild Perform Partial CI Build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants