laravel-form-builder
laravel-form-builder copied to clipboard
Old options will remain
If I want to change rules and the number of rules is too small, the old rules will remain.
$form = $this->plain()
->add(
'email',
'email',
[
'rules' => [
'rule_a',
'rule_b',
'rule_c',
],
],
);
$form->modify(
'email',
'email',
[
'rules' => [
'rule_d',
],
],
);
Modified rules is
$form->email->getOption('rules');
// [
// 'rule_d',
// 'rule_b',
// 'rule_c',
// ],
But I expect
$form->email->getOption('rules');
// [
// 'rule_d',
// ],
It seems that was intentional..? Kinda? See #577 - I'm lost...
I had missed out on that PR. Thanks for letting me know.
However, I think this problem applies to all options of type list, such as choice
.
I'm just as eager to make this project better as you are.
Thank.
I'm just as eager to make this project better as you are.
We need a few rewrites. No more ParentType
(choice
) for select/radios/checkboxes, better options merging, better collection value/models, fixing the form
field, probably more, lots of BC breaks.