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

File not stored as serialized array when using multiple => true and only one file is uploaded #71

Open
fritzmg opened this issue Aug 25, 2020 · 3 comments

Comments

@fritzmg
Copy link
Sponsor Collaborator

fritzmg commented Aug 25, 2020

When using 'multiple' => true and a front end user only uploads one file instead of multiple ones, then the file is not stored as an array. The widget's value will only be the file itself (or its UUID), instead of an array of files. Only when you upload 2 or more files the widget's value will be an array.

@qzminski any pointers where to look for? During debugging I somehow could not find the responsible code.

Also I am not sure how this should be fixed. Technically this might be a BC break, if this behaviour is changed in future versions?

@qzminski
Copy link
Member

qzminski commented Oct 7, 2020

Sorry for the late reply. Did you manage to fix it? If there is a multiple flag set, then it should always return the array of files. It could be indeed a BC break but at the same time it is a bug so 🤷🏻‍♂️

I think it has to happen either here https://github.com/terminal42/contao-fineuploader/blob/master/src/Validator.php#L39 or here https://github.com/terminal42/contao-fineuploader/blob/master/src/Widget/BaseWidget.php#L216 but likely in the latter one …

@fritzmg
Copy link
Sponsor Collaborator Author

fritzmg commented Oct 7, 2020

No, I did not manage to fix it yet. I simply handled it after the fact in our application, but it would be nice, if the fineuploader actually serialized it correctly, even if it is just one file :). I'll have a look at it again, if I get to it (although the projects where I needed it have now come to an end).

@qzminski
Copy link
Member

qzminski commented Oct 7, 2020

Okay then before breaking things right away, let's come back to this when either of us has a project that uses this bundle 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants