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 files fieldtype #10441

Merged
merged 1 commit into from
Jul 12, 2024
Merged

[5.x] Fix files fieldtype #10441

merged 1 commit into from
Jul 12, 2024

Conversation

duncanmcclean
Copy link
Member

This pull request fixes an issue with the Files Fieldtype (which powers the "Re-upload asset" action).

In #10272, we dropped the default values from various fieldtypes, including the Files fieldtype, since the default values weren't really needed.

This caused an issue with the Files fieldtype which we attempted to fix in #10333, however, that PR only fixed the rendering of the fieldtype. You'd get another error related to the value not being set after uploading a file.

This PR fixes it by reverting the fix from #10333, and instead returning an empty array in the fieldtype's preProcess method so that value is never null.

Fixes #10440.

@andjsch
Copy link
Sponsor Contributor

andjsch commented Jul 12, 2024

Hey @duncanmcclean
By accident, I stumbled upon an related issue today, regarding #10272. I do have a private API to fetch form submissions, which causes an error (but only on newly created forms > only there the config fields are missing) while calling 'visibility' => $field->config()['visibility'].

What I do wonder now: should calling $field->config() merge the defaults? It doesn't right now.

@jasonvarga
Copy link
Member

Please open a separate issue.

@jasonvarga jasonvarga merged commit 51f85f4 into 5.x Jul 12, 2024
18 checks passed
@jasonvarga jasonvarga deleted the fix-files-fieldtype branch July 12, 2024 14:45
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.

Reupload asset broken
3 participants