How to configure the sync to upload private/public files?

Created on 16 January 2019, almost 6 years ago
Updated 27 March 2023, over 1 year ago

I am trying to configure my drupal to use the sync option

but when I add the following lines:

$schemes = [

  'public' => [           // The name of the stream wrapper.

    'driver' => 'local',         // The plugin key.

    'config' => [
      'root' => 'sites/default/files',
      'public' => TRUE,                          // In order for the public setting to work,
                                                 // the path must be relative to the root
                                                 // of the Drupal install.

    // Optional settings that apply to all adapters.

    'name' => 'Drupal public files', // Defaults to Flysystem: scheme.
    'description' => 'Drupal public scheme',  // Defaults to Flysystem: scheme.

    'cache' => TRUE,             // Cache filesystem metadata. Not necessary for
                                 // the local driver.

    'replicate' => 's3',         // 'replicate' writes to both filesystems, but
                                 // reads from this one. Functions as a backup.

    'serve_js' => TRUE,          // Serve Javascript or CSS via this stream wrapper.
    'serve_css' => TRUE,         // This is useful for adapters that function as
                                 // CDNs like the S3 adapter.
    ],
  ],

...
];

The whole site break down with this error:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\flysystem\FlysystemBridge::getDirectoryPath() in Drupal\flysystem\Routing\FlysystemRoutes->routes() (line 73 of modules/contrib/flysystem/src/Routing/FlysystemRoutes.php). 

The mentioned FlysystemBridge.php file indeed doesnt have the getDirectoryPath method.

I have ran composer install from the Flysystem folder, it created the vendors subfolder within. Do I need to do any other step?

I got inspiration from this page but it looks outdated: https://www.drupal.org/project/flysystem/issues/2541116 πŸ“Œ Installation and configuration of Flysystem and Flysystem S3 Fixed
The mentioned init.sh or init.php is missing, btw.

πŸ’¬ Support request
Status

Active

Component

Documentation

Created by

πŸ‡§πŸ‡·Brazil afeijo Porto Alegre

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