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

old() function does not work with arrays #47

Closed
JamesPoel opened this issue Sep 5, 2018 · 3 comments
Closed

old() function does not work with arrays #47

JamesPoel opened this issue Sep 5, 2018 · 3 comments

Comments

@JamesPoel
Copy link
Contributor

JamesPoel commented Sep 5, 2018

Example:

{{ bs()->text('profile[first_name]', $user->first_name) }}

If you submit a form containing the above, and there is a validation error, the value previously inputted into the form is not loaded back into the field.

Caused by ln 31 of OldFormInputProvider.php.
return $this->request->old(field_name_to_id($key), $default);

field_name_to_id($key) translates to "profile_first_name", wheras it should be "profile.first_name".

Changing the line to simply return $this->request->old($key, $default);, solves the issue.

@vpratfr
Copy link
Member

vpratfr commented Sep 5, 2018

Hi,

would you be able to submit a PR for a fix?

@JamesPoel
Copy link
Contributor Author

Done

@JamesPoel
Copy link
Contributor Author

Still not merged, causing a fair bit of problems :( Had to edit the file directly for now... ha

@vpratfr vpratfr closed this as completed Mar 12, 2020
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

No branches or pull requests

2 participants