S3FS compatibilty: TypeError: Drupal\geolocation\MapProviderBase::__construct(): Argument #6 ($fileSystem) must be of type Drupal\Core\File\FileSystem, Drupal\s3fs\S3fsFileService given

Created on 22 April 2024, 12 months ago
Updated 11 May 2024, 11 months ago

Problem/Motivation

Hello,
I met an issue with module S3FS 8.x-3.4 enabled and configured on a Drupal 10.2.4 project.
Indeed, it seems to decorate the FileSystem class with S3fsFileService, and when I tried to use Geolocation Map (4.0.0-alpha5), I got the following error:

TypeError: Drupal\geolocation\MapProviderBase::__construct(): Argument #6 ($fileSystem) must be of type Drupal\Core\File\FileSystem, Drupal\s3fs\S3fsFileService given

Steps to reproduce

Install and configure S3FS, install Geolocation and add a Geolocation field, try to use the widget Geolocation Map and the ajax query can not finish because of this error.

Proposed resolution

Instead of using the class FileSystem, use FileSystemInterface seems to fix the issue.
You'll find an attached patch.

🐛 Bug report
Status

Fixed

Version

4.0

Component

Geolocation Field / Backend

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