Media Library does NOT support Private Files at all

Created on 1 August 2022, over 2 years ago
Updated 29 February 2024, 10 months ago

Problem/Motivation

There does NOT seem to be ANY way to utilize Private File System in Media Library (although documentation mentions that it is possible for D8.)

Not at the Content Type Field Level via Manage Fields nor at the Configuration > Media Library screens

Tested in Drupal 9.4.4.

Steps to reproduce

Create and configure Drupal 9 Private File system in settings.php

Ex:


/**
 * Private file system settings in Drupal 9
**/
$settings['file_private_path'] = $app_root . '/../private_files';

Then try and create a Media field in your content type.

You will notice that regular File fields can use Private Files, but not Media fields.

This confusion has come up for other people before:

** https://www.drupal.org/forum/support/post-installation/2022-02-17/make-m... β†’
** https://www.drupal.org/docs/8/core/modules/file/overview β†’ << this talks about regular Files, but not how they relate to Media

Proposed resolution

Document that the private file setting needs to be configured on the file field within the media type.

Remaining tasks

Update documentation on this page https://www.drupal.org/docs/8/core/modules/media/setting-up-private-acce... β†’ to pair with Inform users that media items don't inherit access control from parents πŸ“Œ Inform users that media items don't inherit access control from parents Needs work or better on a separate page within https://www.drupal.org/docs/8/core/modules/media/overview β†’ (as an individual media item can still be unpublished or access controlled some other way, and private files will respect that if configured).

User interface changes

Should be able to globally set this in Media Library configuration pages, here:

* admin/config/media/media-library
* admin/config/media/media-settings

And at the Manage Field level of the Content Type as well

API changes

None.

Data model changes

None.

Release notes snippet

πŸ’¬ Support request
Status

Needs work

Version

11.0 πŸ”₯

Component
DocumentationΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States jacov

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