Support Flysystem 3 with Glide#5551
Merged
Merged
Conversation
The exception class only exists in Flysystem v1. Putting it in an if statement prevents it being constructed until its actually ready to be used. I added tests as a todo to fox that section since the exception class is still wrong.
jasonvarga
added a commit
that referenced
this pull request
Jul 2, 2026
mimeType(), lastModified(), fileSize(), listContents(), and visibility() were empty stubs that always crashed with a TypeError (no code path satisfies their strict return types). They had real HEAD-request-based implementations before the Flysystem v1->v3 migration (#5551), but were converted to stubs during that migration and never ported forward - the underlying head() request infrastructure this class still has today was left unused for these methods. Confirmed unreachable in Statamic's current usage (Glide skips validation for remote URLs; nothing in Flysystem's internals calls these for this adapter), so there's no working behavior to restore. Instead, throw Flysystem's own UnableToRetrieveMetadata/ UnableToListContents exceptions - the same contract other Flysystem adapters use to signal a genuinely unsupported operation, rather than crashing with a raw TypeError.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5358
When using Glide to point to a non-asset there would be errors because there was still Flysystem v1 specific code.
A non-asset meaning either:
publicdirectoryFor the public directory stuff, we use Laravel's on-demand disks pointing to the public directory. This pushes the Flysystem-specific code off to Laravel, which already handles both versions. This method wasn't available when we supported Laravel 6/7.
For the external url stuff I've added Flysystem v3 compatible version of the Guzzle adapter. It doesn't do everything an adapter should do, but has enough for our use case.