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

Bug: form_upload second parameter VALUE is not used in source code #2967

Closed
crustamet opened this issue May 10, 2020 · 4 comments
Closed

Bug: form_upload second parameter VALUE is not used in source code #2967

crustamet opened this issue May 10, 2020 · 4 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@crustamet
Copy link
Contributor

This is the code in form_helper

function form_upload($data = '', string $value = '', $extra = ''): string
{
	$defaults                = [
		'type' => 'file',
		'name' => '',
	];
	is_array($data) || $data = ['name' => $data];
	$data['type']            = 'file';

	return '<input ' . parse_form_attributes($data, $defaults) . stringify_attributes($extra) . " />\n";
}

Surely we see that the $value is not used inside this function. from the source code

@crustamet crustamet added the bug Verified issues on the current code behavior or pull requests that will fix them label May 10, 2020
@crustamet
Copy link
Contributor Author

And because of this set_value for files does not work.
I am trying to upload a file and when i have form errors from validation rules
the upload file gets removed.

I am trying a bunch of shit code to fix this. So much work i have to do with form_upload and set_value dude.

@crustamet
Copy link
Contributor Author

No one ? 🗡️
Please someone review this. This is very important to me.
I am eager to show you the code how i resolve this very weird but i got up some very big problems with it.
Someone please comment here about this issue Thanks.

@michalsn
Copy link
Member

I don't think this is possible. This is blocked on a browser level. Maybe there is some hacky way to accomplish this, but this would be a security issue.

The valid question is why do we have $value variable there, but I guess it is because of the direct import from CI3.

@crustamet
Copy link
Contributor Author

i have a way to save the file if was valid file anyways. and store it but i don't know how to implement this in the firm helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants