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

filename standardization on upload #347

Open
5 tasks done
StudioZut opened this issue Jan 13, 2025 · 0 comments
Open
5 tasks done

filename standardization on upload #347

StudioZut opened this issue Jan 13, 2025 · 0 comments
Assignees

Comments

@StudioZut
Copy link
Contributor

StudioZut commented Jan 13, 2025

When content editors upload images and pdfs etc, ensure that files are renamed to avoid whitespace, capitalization, and special characters -- basically anything that isn't a-z or 0-9 or a dash (an underscore is also ok if that's a nuisance to avoid).

Additional request -- can we force files to have a name that isn't just numbers? To avoid a bunch of files named 01.jpg

Much of this might be functionality added to core as of 10.2. See https://www.drupal.org/node/2972665

Dev tasks:

  • Enable transliteration at admin/config/media/file-system and check all the boxes under it.
  • Export that config back to the wri_sites repo, and add an update hook for it.
  • The "Name" field on an image upload is already required. See if you can add additional quality check to also ensure the name contains something other than numbers and the extension (so no "01.jpg").
  • On media save, try to update the filename to be the transliterated cleaned-up version of the media "Name" field.
  • Make sure this doesn't interfere with the "_1", "_2" suffixes that you get if the name of the post-transliterated file already exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants