Commit 079702cc authored by Leon Kessler's avatar Leon Kessler
Browse files

Issue #3159928: uriScheme() method missing after update to Drupal 9

parent 66bb7ac1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
  "require": {
    "drupal/flysystem": "^2.0",
    "league/flysystem": "^1.0.20",
    "league/flysystem-aws-s3-v3": "^1.0, !=1.0.12, !=1.0.13"
    "league/flysystem-aws-s3-v3": "^1.0, !=1.0.12, !=1.0.13",
    "drupal/core": "^9.0"
  }
}
+1 −2
Original line number Diff line number Diff line
name: Flysystem Amazon S3
description: 'Provides an Amazon S3 plugin for Flysystem.'
type: module
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9
version: 8.0-dev
package: Flysystem
dependencies:
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ class S3CorsUploadAjaxController extends ControllerBase {
    $post = $request->request->all();

    /** @var \Drupal\flysystem_s3\Flysystem\Adapter\S3Adapter $adapter */
    $scheme = \Drupal::service('file_system')->uriScheme($post['destination']);
    $scheme = StreamWrapperManager::getScheme($post['destination']);
    $adapter = $this->flysystemFactory->getPlugin($scheme)->getAdapter();

    $client = $adapter->getClient();
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ class FlysystemS3FileSystem extends FileSystem {
   * @see \Twistor\FlysystemStreamWrapper::stream_metadata
   */
  public function chmod($uri, $mode = NULL) {
    $scheme = parent::uriScheme($uri);
    $scheme = $this->streamWrapperManager::getScheme($uri);

    if ($this->isPrivateS3Scheme($scheme)) {
      is_dir($uri) ? $mode = 0700 : $mode = 0600;
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Drupal\flysystem_s3;

use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StreamWrapper\StreamWrapperManager;

/**
 * Helper for altering and processing a managed_file element for CORS upload.
@@ -33,7 +34,7 @@ class S3CorsManagedFileHelper {
    // has permission to upload files using CORS.
    $element['#s3_cors'] = FALSE;

    if (!empty($element['#upload_location']) && $scheme = \Drupal::service('file_system')->uriScheme($element['#upload_location'])) {
    if (!empty($element['#upload_location']) && $scheme = StreamWrapperManager::getScheme($element['#upload_location'])) {
      if (static::isCorsAvailable($scheme)) {
        // @todo Verify account permission/role respected with cache tags.
        // Disable the default progress indicator.