Skip to content

feat(files): add command to automatically rename filenames #51608

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Mar 20, 2025

Summary

Make it easier for admins to rename all files when e.g. enabling Windows compatibility (ref #44963 ).

Checklist

@susnux susnux force-pushed the feat/sanitize-filenames-command branch 2 times, most recently from 4343ae9 to 0f0846f Compare April 4, 2025 17:18
@susnux susnux marked this pull request as ready for review April 4, 2025 17:19
@susnux susnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 4, 2025
@github-project-automation github-project-automation bot moved this to 🏗️ In progress in 📁 Files team Apr 4, 2025
@susnux susnux added the pending documentation This pull request needs an associated documentation update label Apr 4, 2025
parent::configure();

$this
->setName('files:windows-compatible-filenames')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name could be more self-explanatory :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a suggestion? I think the name is already very verbose

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this windows only? Or is there other reasons to enable this?
If windows only: files:fix-invalid-windows-filenames
If more general: files:fix-invalid-filenames ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different command. It is not about fixing but about enabling the WCF feature (windows compatible filenames).
This enforces windows compatible filenames (see also existing flag in files admin settings)

@susnux susnux self-assigned this Apr 16, 2025
@susnux susnux requested a review from come-nc April 16, 2025 13:21
@susnux susnux force-pushed the feat/sanitize-filenames-command branch from 0f0846f to 5f0e99a Compare April 16, 2025 13:21
@Rello
Copy link
Contributor

Rello commented Apr 23, 2025

Hello @susnux
thank you for this PR. Frank is requesting this for our instance also.

What do you think about a simulation-parameter?
it would be interesting to output the files to be renamed in a test-run first to give the admin an idea bout the scope

@susnux susnux force-pushed the feat/sanitize-filenames-command branch from d2481e2 to 1ec65e7 Compare April 23, 2025 17:51
@susnux
Copy link
Contributor Author

susnux commented Apr 23, 2025

What do you think about a simulation-parameter?

This is implemented using --dry-run.

@ChristophWurst ChristophWurst mentioned this pull request Apr 24, 2025
8 tasks
susnux and others added 2 commits April 24, 2025 10:52
Co-authored-by: Ferdinand Thiessen <[email protected]>
Co-authored-by: Côme Chilliet <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the feat/sanitize-filenames-command branch from 1ec65e7 to 437349c Compare April 24, 2025 08:52
@marcelklehr
Copy link
Member

marcelklehr commented Apr 24, 2025

Can we please expose the sanitizeName method in OCP? By adding it directly to IFilenameValidator perhaps? This would be very useful for integration apps like integration_google, integration_dropbox etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement feature: files pending documentation This pull request needs an associated documentation update 🍂 2025-Autumn
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

Automatically renaming old filenames when enforcing windows filenames
5 participants