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

Introducing the FileUploadNormalizer #221

Merged
merged 2 commits into from
May 22, 2024
Merged

Conversation

Toflar
Copy link
Collaborator

@Toflar Toflar commented May 22, 2024

I'm extracting this from the NC2 because I also need it in mp_forms soon.
The problem is that Contao's file uploads in the form generator (Form.php) accesses file uploads from the widget itself and there is no defined API. The built-in upload form field generates a typical PHP upload array. Fineuploader returns a UUID but only if you enabled storing the upload otherwise it's different. Then there are other form fields as well. Some return multiple values, others just one. It's a mess.

The FileUploadNormalizer is my answer to this problem until we have a nicer API in Contao. It supports PHP native uploads, UUIDs and regular paths and arrays of all of that.

@Toflar Toflar marked this pull request as ready for review May 22, 2024 07:29
@Toflar Toflar requested a review from qzminski May 22, 2024 07:29
@Toflar Toflar force-pushed the feature/file-upload-normalizer branch from 7898019 to e1d09c7 Compare May 22, 2024 07:36
@qzminski qzminski merged commit 19abfc2 into main May 22, 2024
6 checks passed
@qzminski qzminski deleted the feature/file-upload-normalizer branch May 22, 2024 09:23
@qzminski qzminski assigned qzminski and Toflar and unassigned qzminski May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants