nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.38k stars 4.07k forks source link

Link formatting changed (after upgrading to NC28?) when opening files [same in latest v27 too] #43606

Closed cguillaumie closed 8 months ago

cguillaumie commented 8 months ago

Describe the bug after migration, our links to open files in collabora changed from : https://ourcloud.contoso.com/apps/files/?dir=/path_to_the_dir&openfile=138540 to : https://ourcloud.contoso.com/apps/files/files/138540?dir=/path_to_the_dir&openfile=true

To Reproduce nothing to do always the same

Expected behavior reverse this formatting or change it on the fly?

Client details:

Server details

Operating system: ubuntu 22.04

Web server: nginx

Database: mariadb

PHP version: 8.1

Nextcloud version: 28.02

Version of the richdocuments app 8.3.1

Version of Collabora Online: 23.5.705

Configuration of the richdocuments app

{
    "apps": {
        "richdocuments": {
            "canonical_webroot": "",
            "disable_certificate_verification": "yes",
            "enabled": "yes",
            "external_apps": "",
            "installed_version": "8.3.1",
            "public_wopi_url": "https:\/\/cloud.contoso.com",
            "types": "prevent_group_restriction",
            "wopi_allowlist": "0.0.0.0\/0",
            "wopi_url": "https:\/\/cloud.contoso.com\/apps\/richdocumentscode\/proxy.php?req="
        }
    }
}
Logs #### Nextcloud log (data/nextcloud.log) ``` Insert your Nextcloud log here ``` #### Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
joshtrichards commented 8 months ago

Reproduced, but this isn't limited to Collabra/Office documents (e.g. same for Markdown files) so not richdocuments matter. I was about to move this to server since it seems to be a Files matter, but in looking closer may be correct behavior. It's similar in v27 (though with some variance - more on that in a moment).

Good eye and I I can see how it might appear funny! A quick look suggests it just happens that the id/name of the "All files" view/route is files and it's provided by the Files app (which has the base URL /apps/files). e.g.

https://github.com/nextcloud/server/blob/1f0cba5f991a3c12d230284b3d96f91fb50312fd/apps/files/appinfo/routes.php#L136-L140

https://github.com/nextcloud/server/blob/1f0cba5f991a3c12d230284b3d96f91fb50312fd/apps/files/src/views/files.ts#L30-L33

There's no functionality issue as far as I can tell from a quick initial look.

Though the paths/parameters have changed slightly (openfile and fileId). I'll still bump this over to server since I'm not familiar enough to say with certainty.

szaimen commented 8 months ago

cc @nextcloud/server-frontend

susnux commented 8 months ago

The official supported URL to use for linking to files is /f/FILEID that worked with "old" versions of Nextcloud and is also working with Nextcloud 28.

Meaning in your case it would be https://ourcloud.contoso.com/f/138540

This can also be accessed from the sharing tab by using the "internal link".

joshtrichards commented 8 months ago

I took the original report to be about the URLs that show up while opening files (e.g. Office, Markdown) from within Files in the browser URL slot. That's also how I tested against v27 & v28.

joshtrichards commented 8 months ago

And this:

https://ourcloud.contoso.com/apps/files/?dir=/path_to_the_dir&openfile=138540 to : https://ourcloud.contoso.com/apps/files/files/138540?dir=/path_to_the_dir&openfile=true

...also stood out because of the fileId and openfile parameters changing. Mostly the openfile=true versus openfile=<fileId> which stands out as a little weird to me, but maybe that's just an change internally and not a problem.