nextcloud / nextcloud/groupfolders

Trailing whitespace not removed in folder names when using occ groupfolders:create command which can lead to broken nesting

Open
#3,786 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug hot spot: filename handling
Dominant language
PHP
Stars
343
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
34

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
Steps to reproduce
  1. Create a groupfolder with trailing whitespace using the occ command and a subfolder: sudo -u www-data php /var/www/nextcloud/occ groupfolders:create "Test folder " and then sudo -u www-data php /var/www/nextcloud/occ groupfolders:create "Test folder/Test Subfolder"
  2. Observe that the folders do not nest properly:
Image
  1. Observe that the trailing whitespace is visible in the Web GUI once the folder name is being edited:
Image
Expected behaviour

Whitespace at the end or beginning of a folder name is automatically trimmed when the group folder is created as per: https://github.com/nextcloud/groupfolders/issues/2990

Actual behaviour

The trailing whitespace is not trimmed leading to issues with nesting

Server configuration

Operating system: Debian 12

Web server: NGINX

Database: Postgresql

PHP version: 8.2

Nextcloud version: (see Nextcloud admin page) 31.0.4

Team folders version: 19.0.4

Updated from an older Nextcloud/ownCloud or fresh install: updated

Where did you install Nextcloud from: official installation method

Are you using external storage, if yes which one: no

Are you using encryption: bo

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox

Operating system: MacOS

Logs

No related error logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the occ groupfolders:create command and compare its handling of leading and trailing whitespace with the behavior described in issue #2990. Reproduce the nested-folder case, then verify that created group folder names are trimmed and that the subfolder appears under the intended parent in the Web GUI.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.