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

Allow upload multiple #1380

Merged
merged 6 commits into from
Jul 31, 2020
Merged

Allow upload multiple #1380

merged 6 commits into from
Jul 31, 2020

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Jul 25, 2020

this PR adds support to multiple files to be uploaded, but only uploaded - the Upload control still remains for one file only

original fx signatures remains - now only more files can be passed

marking as BC breaks as no special "error" string param is passed anymore

$files[] = $_FILES[$k];
}

if (count($files) > 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remains for 1 file only like before and the whole control component

$img->onUpload(function ($files) use ($form, $img) {
if ($files === 'error') {
$img->onUpload(function ($postFile) use ($form, $img) {
if ($postFile['error'] !== 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we pass now in native php FILES format, also if error

@mvorisek mvorisek force-pushed the allow_upload_multiple branch 2 times, most recently from 0daeebd to 87ba48c Compare July 25, 2020 23:50
@mvorisek mvorisek force-pushed the allow_upload_multiple branch 2 times, most recently from 77feaa9 to 9f5bf52 Compare July 28, 2020 18:58
@mvorisek mvorisek marked this pull request as ready for review July 30, 2020 11:08
$fileName = $_POST['f_name'] ?? null;
$this->cb->set(function () use ($fx, $fileName) {
$this->addJsAction($fx($fileName));
$this->hasUploadCb = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->hasUploadFx ?
But only if we can refactor $this->cb to $this->fx (BC)
To keep all naming consistent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is related with Callback, lets fix this in #1377

@mvorisek mvorisek merged commit dfb4e7b into develop Jul 31, 2020
@mvorisek mvorisek deleted the allow_upload_multiple branch July 31, 2020 08:42
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