-
Notifications
You must be signed in to change notification settings - Fork 297
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
ParentType disable()/enable() fix #705
Conversation
7531347
to
5539a20
Compare
I dislike |
I don't understand why my forks master contains 2 commits from label_template feature that were not merged yet pull request was. I use ChoiceType which means dealing with ParentType. I know it has some problems and I finally found a time to fix one that bothered me from time to time. If you prefer I might rebase those template_label related commits out of my branch. As feature was already merged I would live them there. |
16e1995
to
adf2ca0
Compare
Can you remake the diff/PR?, because there's a lot of different stuff in here. That will be confusing in the future. And can you explain the problem this fixes? Does that problem only happen if you use |
- Parent Field when disabled or enabled did only populate information to its children and forgot about it itself. - fixed some typing error - extended tests for disable/enable functionality - added `attr` population for some ParentType derivatives - added variant specific config (wrapper_class, label_class, field_class) for choice type
I rebased branch to keep just fix commit here and those left commits for |
And can you explain the problem this fixes? Does that problem only happen if you use |
I experience it using ChoiceType field with |
Oh man I really don't like (or understand anymore) |
All tests checks out so I would assume it works without breaking those types beyond current state. I use forked version with this fix for some time and have no complaints for neither This was done long enough so I'm not sure but it seems some other changes made on already built form are ignored for parent based fields without it. This was a reason why more then 'disabled' attribute is copied. EDIT: looking through issues I see it is also fix for already reported problem in #536. |
Alright, let's do it. I can always blame you when someone complains ;) |
Fields extending
ParentType
don't act properly when disabled. For exampleChoiceType
withrequired
rule is not disabled even if asked nicely withdisable()
method. This is due to factattr
option gets copied to children from parent while rendering but it doesn't containdisabled
attribute afterdisable()
method was called.Fixed
disable()
andenable()
method to act uponParentType
field itself before populating information to children. Added functionality tests to all derivatives (as ParentType is abstract and has no tests written so far).Don't know why it ads some code from previous PR that was already merged. Those changes were made during Pull Request review.