Is it expected that s3fs will override Drupal\Core\File\FileSystem service?

Created on 7 April 2023, almost 2 years ago
Updated 22 April 2023, almost 2 years ago

Problem/Motivation

I have a custom module in place with a service that itself calls on Drupal's file_system service via dependency injection [Drupal\Core\File\FileSystem]. After installing s3fs, the following exception is thrown whenever the my module's service is called:

TypeError: Argument 1 passed to Drupal\my_module\Service\Credentials::__construct() must be an instance of Drupal\Core\File\FileSystem, instance of Drupal\s3fs\S3fsFileService given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php 

I haven't configured s3fs to be used with public or private files, nor have I configured the File system /admin/config/media/file-system to use S3 (it's still set to "Public local files served by the webserver.").

The s3fs module seems to be taking over the file system in a manner that, perhaps, I don't fully understand. Is what I described expected behavior? I do see that that s3fs_streamwrapper.filesystem_servicee is decorating file_system...just not certain how this may come into play.

Cheers.

πŸ’¬ Support request
Status

Fixed

Version

3.1

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024