matthewbdaly/laravel-azure-storage

Change in prefix causes incompatibility with

Ahrengot opened this issue · 4 comments

Checklist

This package is just a wrapper for Flysystem's Azure storage backend to integrate it with Laravel's storage API. As such, many problems users may experience with it may actually be issues with Flysystem, the Azure driver for Flysystem, or Microsoft's PHP SDK. To help eliminate these issues, please confirm the following:

  • I'm able to instantiate a Flysystem instance using the same credentials as passed to this package.
  • The Flysystem instance works as expected, and the bug I am reporting is not reproducible when interacting directly with Flysystem
  • I can instantiate the Microsoft Azure PHP SDK successfully and can interact with my file successfully using that

Describe the bug
It seems that this change 6ef1a1a that updated the default disk prefix from null to the actual string 'prefix' is causing issues. I have a project with around 4000 uploaded files. After upgrading this package from 1.6.0 to the latest version, all of my files disappeared.

I noticed that files uploaded after the upgrade would be named "prefix/foo.jpg" instead of just "foo.jpg". Changing the prefix value to an empty string fixed the issue.

To Reproduce
Steps to reproduce the behavior:

  1. Upload a file with an older version. e.g. 1.6
  2. Upgrade to the latest version
  3. run Storage::allFiles()
  4. The previously uploaded file wont be listed
  5. Change prefix in config/filesystems.php from null to an empty string
  6. The previously uploaded file will now be listed

Packages and PHP version

  • PHP version: 8.1
  • Laravel version: 9.17
  • Version of this package: 20.

I've just released a new version of the package that should fix this issue. Can you confirm it resolves it for you?

Looks like the update fixed it for me. Thank you!

Great to hear.

Yep, it works for me as well. Thanks for fixing this!