Skip to content

Conversation

jcrombez
Copy link
Contributor

@jcrombez jcrombez commented Dec 1, 2011

No description provided.

@stof
Copy link
Member

stof commented Dec 1, 2011

@francisbrass returning the optiosn passed by the end-user kills one of the features of the Form component, which is validating that you pass only supported options (typos resulting in errors instead of being ignored). The method is really meant to return the default options, not to merge the options with the defaults.
Merging is handling in another part of the component already to build the final option array. So this change is the good one.

@jcrombez
Copy link
Contributor Author

jcrombez commented Dec 2, 2011

@stof : do you know why there is $options in argument ? It doesn't really make sense with the purpose of returning the default options value. It's a legacy from an old way of handling form options ?

@stof
Copy link
Member

stof commented Dec 2, 2011

because some default values can depend of some other values passed by the user. Look at the choice type for instance. The default empty value depends of the multiple option.

@weaverryan
Copy link
Member

Thanks guys!

Merged into the 2.0 branch at sha: 5479ba6

I had also wondered what the purpose of the incoming $options was, since you never see people returning it. I understand the reason why, but it is an unfortunate signature.

Thanks!

@weaverryan weaverryan closed this Dec 2, 2011
@francisbrass
Copy link

@stof : thank you for the info, I should have pay more attention :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants