[Bug]: Web UI sorts files with double extensions (e.g. .mp3.txt) incorrectly

Aperta
#66,943 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

The payload names no source file, so start by finding the name-sort comparison used by the Files web UI in the frontend code. Reproduce with the four empty files from the steps (datei-a.mp3, datei-a.mp3.txt, datei-b.mp3, datei-b.mp3.txt) and confirm the current order. Done when name-ascending sorting places each .mp3.txt directly after its .mp3 without breaking other name sorts. The issue also suggests the change could be optional, which a maintainer should confirm before you implement it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

0. Needs triage 35-feedback bug
⚠️ This issue respects the following points: ⚠️
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description

In the Files web interface (Nextcloud Hub 26 Summer 35.0.3), files with double extensions are not sorted together with their corresponding base files. Instead, the web UI separates the basename before the last dot and ignores/deprioritizes the dot during comparison, grouping all .mp3 files before .mp3.txt files.
Both the Windows Desktop client and the Android client sort the full filename string naturally and display .mp3.txt right below .mp3.

Steps to reproduce
  1. Open a folder in the Nextcloud 35 Files web app.

  2. Create or upload the following four empty files:
    • datei-a.mp3
    • datei-a.mp3.txt
    • datei-b.mp3
    • datei-b.mp3.txt

  3. Sort the list by Name (ascending).

Actual behavior:
The web UI sorts by the substring before the last extension (datei-a, datei-b, datei-a.mp3, datei-b.mp3), resulting in:
• datei-a.mp3
• datei-b.mp3
• datei-a.mp3.txt
• datei-b.mp3.txt

It occurs with all multiple file extensions.

Expected behavior

Expected behavior:
Files should be sorted by their full filename string, matching the behavior of desktop OS file managers and Nextcloud mobile/desktop clients:
• datei-a.mp3
• datei-a.mp3.txt
• datei-b.mp3
• datei-b.mp3.txt

Nextcloud Server version

35

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.5

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cumulus.hrs19.de"
        ],
        "serverid": "cumulus-single-server",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cumulus.hrs19.de",
        "htaccess.RewriteBase": "\/",
        "dbtype": "mysql",
        "version": "35.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Berlin",
        "installed": true,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "maintenance": false,
        "integrity.ignore.missing.app.signature": [
            "theme-hrs19"
        ],
        "theme": "",
        "loglevel": 0,
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "allow_user_to_change_mail_address": "",
        "default_phone_region": "DE",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "maintenance_window_start": 2,
        "auth.bruteforce.protection.enabled": true,
        "blacklisted_passwords": [],
        "forbidden_filename_basenames": [
            "con",
            "prn",
            "aux",
            "nul",
            "com0",
            "com1",
            "com2",
            "com3",
            "com4",
            "com5",
            "com6",
            "com7",
            "com8",
            "com9",
            "com\u00b9",
            "com\u00b2",
            "com\u00b3",
            "lpt0",
            "lpt1",
            "lpt2",
            "lpt3",
            "lpt4",
            "lpt5",
            "lpt6",
            "lpt7",
            "lpt8",
            "lpt9",
            "lpt\u00b9",
            "lpt\u00b2",
            "lpt\u00b3"
        ],
        "forbidden_filename_characters": [
            "<",
            ">",
            ":",
            "\"",
            "|",
            "?",
            "*",
            "\\",
            "\/",
            "\n"
        ],
        "forbidden_filename_extensions": [
            " ",
            ".",
            ".filepart",
            ".part"
        ],
        "app_install_overwrite": [],
        "lost_password_link": "disabled",
        "appstoreenabled": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/cumulus.hrs19.de\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/cumulus.hrs19.de\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "skeletondirectory": "\/var\/www\/html\/cumulus.hrs19.de\/custom_skeleton"
    }
}
List of activated Apps
Enabled:
  - activity: 8.0.0
  - appstore: 2.0.0
  - bruteforcesettings: 8.0.0
  - calendar: 6.7.0
  - cloud_federation_api: 2.0.0
  - comments: 2.0.0
  - contacts: 8.10.0
  - contactsinteraction: 2.0.0
  - dashboard: 8.0.0
  - dav: 2.0.1
  - federatedfilesharing: 2.0.0
  - federation: 2.0.0
  - files: 3.0.0
  - files_downloadlimit: 5.3.0
  - files_lock: 35.0.1
  - files_pdfviewer: 8.0.0
  - files_reminders: 2.0.0
  - files_sharing: 2.0.1
  - files_trashbin: 2.0.0
  - files_versions: 2.0.0
  - firstrunwizard: 8.0.0
  - guests: 4.10.1
  - logreader: 8.0.0
  - lookup_server_connector: 2.0.0
  - nextcloud_announcements: 7.0.0
  - notifications: 8.0.1
  - notify_push: 1.4.2
  - oauth2: 2.0.0
  - office: 1.1.0
  - password_policy: 7.0.0
  - photos: 8.0.0
  - privacy: 7.0.0
  - profile: 2.0.0
  - provisioning_api: 2.0.0
  - recommendations: 8.0.0
  - related_resources: 6.0.0
  - richdocuments: 12.0.2
  - serverinfo: 7.0.0
  - settings: 2.0.0
  - sharebymail: 2.0.0
  - sharing: 1.0.5
  - spreed: 25.0.8
  - support: 7.0.0
  - survey_client: 7.0.0
  - systemtags: 2.0.0
  - tasks: 0.18.1
  - text: 9.0.2
  - theming: 3.0.0
  - twofactor_backupcodes: 2.0.0
  - twofactor_totp: 17.1.0
  - updatenotification: 2.0.0
  - user_status: 2.0.0
  - viewer: 8.0.0
  - weather_status: 2.0.0
  - webhook_listeners: 2.0.0
  - workflowengine: 3.0.0
Disabled:
  - admin_audit: 2.0.0
  - app_api: 35.0.0 (installed 32.0.0)
  - circles: 35.0.0 (installed 34.0.0)
  - encryption: 3.0.1
  - files_external: 2.0.0 (installed 1.17.0)
  - files_texteditor: 2.15.1 (installed 2.15.1)
  - suspicious_login: 13.0.0
  - transcriptionfolders: 0.3.0 (installed 0.3.0)
  - twofactor_nextcloud_notification: 9.0.0
  - user_ldap: 2.0.0
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
There are no log entries for this bug because it's a sorting problem in Javascript.
Additional info

This Bug occurs in all current major browsers under Windows 11 (the operation system of my "clients")

I work with several public-sector institutions, and in their workflows, multiple file extensions are an integral part of the process. Files with the same base name are handled as a group. Selecting them one by one from a potentially long list is, frankly, pointless.

And before anyone suggests that these institutions should change their workflows — can you think of anything more immovable than a bureaucrat?

In my personal opinion, this type of sorting should, at best, be an optional feature—it should certainly never be the default.

Lingua principale
PHP
Stelle
37.6k
Fork
5.4k
Merge medio
1g 13h
PR unite (30g)
623

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextcloud/server

Tutte le issue di nextcloud/server

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.