Thanks for saying hello on IRC.
We've made a form builder thing, that allows us to put any field from any entity into the form and have them all save to the right place at the end. This was working well with most fields but we noticed that the field collection table widget didn't display properly.
It looks like field_collection_table uses a form_alter alter hook and makes use of #entity_type, #bundle and the name of the array item for the field, then causes some theme hooks to be triggered than render the widget differently.
Unfortunately, none of these things are available in our forms.
Why was collections tables built this way, rather than using a custom widget? What were the reasons/problems that led to the decision?
This is something that we're going to have to fix for a client within like a week, so we're happy to put all the work in. Just wanted to get your input so we knew what we were up against.
Comments
Comment #1
andrewbelcher CreditAttribution: andrewbelcher commentedThe work around for it in case anyone else needs it is to set the following two settings manually on your form:
Comment #2
rooby CreditAttribution: rooby commentedUnfortunately, like you say, this doesn't work because it relies on the field being on an entity form.
For now the workaround in #1 should suffice but I have opened an issue to change it - #1946978: Use custom widget instead of reusing existing one and then form altering
PS: did you finish that project of the dynamic form?
Comment #3
rlmumfordHi rooby! Thanks for the reply. I might have time to submit a patch to the other issue at some point this week.
The dynamic forms project is still under construction, but definitely usable by a developer. It's in a sandbox at the moment:
Flexible Forms
Comment #4
rooby CreditAttribution: rooby commentedCool, I'll have to check it out some time.