Remove creation date from file_directory? (media/TYPE/y-m/...)

Created on 2 August 2022, over 2 years ago
Updated 7 May 2024, 10 months ago

Problem/Motivation

As we just found out, currently all media items are once again stored into folder/Y/m in the file system. This is the Drupal default and seems to have been (re)set by Media in Core upgrade.

In the past we had issues with folder permissions and that logic by creation date wasn't very helpful.

Steps to reproduce

See for example field.field.media.image.field_image.yml

[...]
settings:
  handler: 'default:file'
  handler_settings: {  }
  file_directory: 'media/image/[date:custom:Y]-[date:custom:m]'
  file_extensions: 'png gif jpg jpeg'
  max_filesize: '16 MB'
  max_resolution: 4068x3051
  min_resolution: ''
  alt_field: true
  alt_field_required: true
  title_field: true
  title_field_required: false
  default_image:
    uuid: ''
    alt: ''
    title: ''
    width: null
    height: null
[...]

Proposed resolution

We should discuss, if it wouldn't be better to put all files into one directory by the media type again, e.g.

  • media/image
  • media/vector_image
  • ...

Remaining tasks

Discuss
Update value in the field.field.media.XXX.YYY config (for future files)

Existing files should be kept as they are to ensure nothing breaks.

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024