Skip to content

fix(files_sharing): respect openfile parameter for external file shares - #65997

Open
sundeep8967 wants to merge 1 commit into
nextcloud:masterfrom
sundeep8967:fix/public-share-respect-openfile-param-65814
Open

sundeep8967 wants to merge 1 commit into
nextcloud:masterfrom
sundeep8967:fix/public-share-respect-openfile-param-65814

Conversation

@sundeep8967

@sundeep8967 sundeep8967 commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

When navigating to an external single-file share link with ?openfile=false, apps/files_sharing/src/init-public.ts previously hardcoded openfile: 'true' during router redirection. This caused the viewer to autoplay or open the file even when explicitly requested not to open it.

This PR checks the current query parameter window.OCP.Files.Router.query.openfile and preserves 'false' when supplied; otherwise it defaults to 'true'.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@susnux

susnux commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

looks good, but please add a playwright regression test for this.
(Also for the future: please keep the PR template in the message.)

@sundeep8967
sundeep8967 force-pushed the fix/public-share-respect-openfile-param-65814 branch from 228053b to 436a30b Compare November 8, 2026 16:47
@sundeep8967
sundeep8967 requested review from a team as code owners November 8, 2026 16:47
@sundeep8967
sundeep8967 requested review from kristian-zendato, skjnldsv and susnux and removed request for a team November 8, 2026 16:47
@sundeep8967

Copy link
Copy Markdown
Author

Added the Playwright regression test under tests/playwright/e2e/files_sharing/public-share/download.spec.ts asserting that opening an external file share with ?openfile=false does not open the viewer modal, and updated the PR description with the template format. Thanks!

When navigating to an external single-file share with `openfile=false`,
the public router initialization previously hardcoded `openfile: 'true'`
in goToRoute(), causing the file viewer to open automatically even when
explicitly requested not to autoplay or open.

Check the current query parameter and preserve 'false' when provided.

Fixes nextcloud#65814

Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
@sundeep8967
sundeep8967 force-pushed the fix/public-share-respect-openfile-param-65814 branch from 436a30b to 66eb628 Compare November 9, 2026 22:02

This branch has not been deployed

No deployments
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.

[Bug]: External links lose openfile parameter value

2 participants