1up-lab / OneupFlysystemBundle

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

When following adapter_awss3.md and keep the default settings it errors. #278

Closed johanadivare closed 1 year ago

johanadivare commented 1 year ago

Bug Report

When i have the following config:

oneup_flysystem:
    adapters:
        acme.flysystem_adapter:
            awss3v3:
                client: acme.s3_client
                bucket: ~
                prefix: ~

I get the following error: League\Flysystem\AwsS3V3\AwsS3V3Adapter::__construct(): Argument #3 ($prefix) must be of type string, null given, called

When i leave out prefix it works or setting prefix: '' also works. Is the handling of the setting wrong or should we change the docs?

johanadivare commented 1 year ago

Also bucket: ~ doesn't work maybe we should keep the same as example in https://flysystem.thephpleague.com/docs/adapter/aws-s3-v3/ So:

bucket: 'bucket-name'
prefix: 'path/prefix'  # Optional path prefix
bytehead commented 1 year ago

Yes, leaving it empty works because it is empty string by default: https://github.com/thephpleague/flysystem-aws-s3-v3/blob/8e04cbb403d4dfd5b73a2f8685f1df395bd177eb/AwsS3V3Adapter.php#LL101C29-L101C29

Would you mind to create a PR that changes the documentation accordingly? :)

bytehead commented 1 year ago

See #279