Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Internal links lose openfile parameter value #50155

Open
5 of 8 tasks
Kharonus opened this issue Jan 13, 2025 · 1 comment
Open
5 of 8 tasks

[Bug]: Internal links lose openfile parameter value #50155

Kharonus opened this issue Jan 13, 2025 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 30-feedback bug feature: files needs info

Comments

@Kharonus
Copy link

⚠️ This issue respects the following points: ⚠️

Bug description

Ahoi,
when using the short file url for opening a file in a browser, the openfile query parameter gets lost on the internal redirects.

So, I do start with the request https://my.nextcloud.internal/f/1337?openfile=false. The nextcloud server redirects to something like https://my.nextcloud.internal/apps/files/files/1337?dir=/Photos&openfile=true. The file is opened.

My intention however is to open the file in the location, hence the given openfile=false, which gets lost in the redirect.

If I change the final url to https://my.nextcloud.internal/apps/files/files/1337?dir=/Photos&openfile=false, the desired state is displayed.

The issue was already reported inside another, related bug: #45731 (comment)

While the bug is fixed, this issue remains.

Steps to reproduce

  1. Fetch any file id of a file that has a browser preview, e.g. an image/png.
  2. Browse to https://[NEXTCLOUD_HOST]/f/[FILE_ID]?openfile=false.

Expected behavior

The browser view shows the parent directory and the chosen file is selected (details sidebar is open and file row is highlighted).

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/html\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "overwriteprotocol": "https",
        "overwrite.cli.url": "https:\/\/nextcloud-sub.local\/html",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud-sub.local"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.4.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "allow_local_remote_servers": "1",
        "theme": "",
        "loglevel": 2,
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - app_api: 4.0.3
  - bruteforcesettings: 3.0.0
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - groupfolders: 18.0.8
  - integration_openproject: 2.7.1
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - encryption: 2.18.0
  - files_external: 1.22.0
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Additional info

No response

@Kharonus Kharonus added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 13, 2025
@joshtrichards joshtrichards changed the title [Bug]: Open file by ID url (short) does not honor query param "openfile" [Bug]: Internal links lose openfile parameter value Jan 13, 2025
@joshtrichards joshtrichards added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jan 13, 2025
@susnux
Copy link
Contributor

susnux commented Jan 14, 2025

The openfile is not a boolean parameter with a value, it is more like HTML boolean attribute meaning if it exists (regardless of the value) it is considered true.

?openfile is the same as ?openfile=true and also as ?openfile=fooo.

You should be able to just drop the openfile at all to get the desired behavior.

@susnux susnux added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 30-feedback bug feature: files needs info
Projects
None yet
Development

No branches or pull requests

4 participants