I'm having trouble getting the selected values after form submit, when the multiple attribute on select is set.
For what I see there is a mismatch between the form fields (Form.php line 1290), and the request fields (Form.php line 1293) where the filtered fields have the array-style key (for instance 'countries[]') and the requests fields have the plain key (for instance 'countries') so that the array_key_exists condition of 'field in request fields' is not matched, and the fields (raw)Value is not (re)set. (Form.php line 1295)
I have the expected behavior when I replace:
if (array_key_exists($field, $request->all())) { //..exists('countries[]',array(....,'countries',...)
I'm having trouble getting the selected values after form submit, when the multiple attribute on select is set.
For what I see there is a mismatch between the form fields (Form.php line 1290), and the request fields (Form.php line 1293) where the filtered fields have the array-style key (for instance 'countries[]') and the requests fields have the plain key (for instance 'countries') so that the array_key_exists condition of 'field in request fields' is not matched, and the fields (raw)Value is not (re)set. (Form.php line 1295)
I have the expected behavior when I replace:
if (array_key_exists($field, $request->all())) { //..exists('countries[]',array(....,'countries',...)
with:
$field=str_replace("[]","",$field);
if($request->has($field)){
Is there a better way to avoid this key with/without [] mismatch, or should we modify the detection in a similar (maybe better) way ?