[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Fix Filesystem AbstractAdapter put method return #11032

Merged

Conversation

godismyjudge95
Copy link
Contributor

I learned about this the hard way. I spent over an hour trying to figure out why a custom media importer I had built was failing on the step only to find out $assetContainer->disk()->put() returns null instead of the normal true/false on success/fail.

Example of what I am trying to solve:

$success = \Statamic\Facades\AssetContainer::find('assets')->disk()->put('test.txt', 'test');

You'd expect if the file is created $success would be true, but it is not. It is null.

This is true of all other methods in the AbstractAdapter so I believe this being left out is just a typo/bug.

One could make an argument this should target 6.x since it changes a return type, but since null was always being returned there should be no logic dependent upon it.

@jasonvarga jasonvarga merged commit b8f73b5 into statamic:5.x Oct 31, 2024
17 checks passed
@godismyjudge95 godismyjudge95 deleted the fix-abstract-file-adapter-put-method branch October 31, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants