Spin-off from #558666: UX/security: Revamp text format/filter configuration
Fieldsets contained in a vertical tab #group are rendered twice, if the fieldset defines custom #parents.
I have absolutely no idea what vertical tabs have in common with #parents in the first place, but changing the logic to be based on #array_parents instead of #parents made them disappear entirely.
Debugging through this weird processing code some more, I found out that it doesn't add the fieldset's #group to $form_state if it defines custom #parents.
I have no idea why vertical tabs are stored by their #parents and not by their #group in $form_state in the first place, but trying to change this equally failed.
Let me state that I'm very confused by this code and the entire code smells like a hack. If you'd ask me, such code should not live in form.inc and definitely belongs into a separate module. But I guess that deserves a separate issue.
Attached patch fixes this bug.
However, I will not update the documentation, because I simply don't understand what this code tries to do, and why it thinks it has to do it. :(
Comment | File | Size | Author |
---|---|---|---|
#11 | drupal.vertical-tabs-parents.11.patch | 9.06 KB | sun |
#9 | drupal.vertical-tabs-parents.9.patch | 7.25 KB | sun |
#7 | drupal.vertical-tabs-parents.7.patch | 6.44 KB | sun |
drupal.vertical-tabs-parents.0.patch | 3.9 KB | sun | |
Comments
Comment #5
sunWhy did we introduce #type 'vertical_tabs' when each fieldset can be a #group on its own?
If each fieldset can form a new vertical tabs group of its own, then the entire idea of introducing a separate #type to form groups is bogus?
Comment #7
sunSo. The implementation is entirely wrong.
In-progress patch attached. Only remaining todo is that fieldsets that refer to a #group that does not exist are not rendered. I'm currently resolving that.
Comment #8
Dave ReidAdding tag and subscribing.
Comment #9
sunoopsie, forgot to merge the required drupal_render() change.
Comment #11
sunThis one should pass and solves the odo I mentioned before.
Comment #12
sunSince the current implementation breaks Form API, I seriously mark this as critical.
Patch passed, so RTBC? I really need to continue that Filter UI patch.
Comment #13
sunSummary:
Problem
Details
Resolution
Comment #14
sunCan we get this in?
Comment #15
sunok, ahem....
Not really cool, but this fix was committed as part of #558666: UX/security: Revamp text format/filter configuration.
Comment #17
yched CreditAttribution: yched commentedFollowup : #857124: Collapsible fieldsets and vertical tabs do not work without form_builder() (Form API)