1up-lab / OneupFlysystemBundle

A Flysystem integration for your Symfony projects.
MIT License
630 stars 119 forks source link

Google Cloud Storage dependency injection error after updating the adapter #266

Closed pdoreau closed 2 years ago

pdoreau commented 2 years ago

Bug Report

This Google Cloud Storage adapter commit introduced a new constructor parameter ($mimeTypeDetector) leading to a dependency injection error.

Q A
BC Break yes
Version 4.4.1

Summary

Update league/flysystem-google-cloud-storage from 3.0.9 to 3.0.15 with oneup/flysystem-bundle 4.4.1

Resulting error :

League\Flysystem\GoogleCloudStorage\GoogleCloudStorageAdapter::__construct(): Argument #5 ($mimeTypeDetector) must be of type ?League\MimeTypeDetection\MimeTypeDetector, string given, called in /app/var/cache/dev/ContainerAIbli  
  xC/srcApp_KernelDevDebugContainer.php on line 5387 

How to reproduce

Without touching configuration, a working project does not work after update.

I managed to fix with this workaround in Kernel.php :

public function process(ContainerBuilder $container)
{
    $container->getDefinition('oneup_flysystem.adapter.googlecloudstorage')->setArgument(4, null);
}

This issue has also been posted in the flysystem repo