-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
[4.0] Form field name as array results in error, when returned back to withInput
#2718
Comments
I also have this problem. After scrolling through the Laravel source a while I found out the same reason why this happens. Is this intended? If so, maybe arrays should be ignored? In my opinion though, as said above, if a specific value is given it should override the default behavior. Especially since there's already an Input::old() method that accepts a default value in case the old value isn't found. |
Having this problem too. |
Ditto. This issue was also mentioned in #2243 |
This problem has been present for as long as I can remember. It is hard to fix and the solution is to manually add an index to your input arrays - e.g. |
I don't have any plans to continue developing the Form and HTML helpers myself, and am going to leave the rest of the development on those pieces up to the community. |
Huh, after some L4 updates, parts of my application have stopped working.
Always end up with:
Full stack trace
The problem appears to start in
FormBuilder::getValueAttribute
, where it looks up old input and favors it before explicit value*:That, runs
FormBuilder::old
that eventually callsFormBuilder::transformKey
, that removes brackets, transformingserver[]
intoserver
, and therefore, returing the array of values not a single value.old
values.What about this example:
If there is no old entry, default to troll, if there is entry, use "ful", the problem, though, is that it always is filled with old entry never returning ful.
A simple reordering fixes both issues.
Is this a bug, intenional and I'm doing something wrong, or...?
The text was updated successfully, but these errors were encountered: