Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301012

Media Library does NOT support Private Files at all

$
0
0

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 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


Viewing all articles
Browse latest Browse all 301012

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>