- Issue created by @donquixote
- 🇩🇪Germany donquixote
An alternative i could think of:
Make the lists of rows, regions and groups alterable in the form array.
To do this, we have to delay the full preparation of the rows to a '#process' callback.
Possibly there could even be an element type for tabledrag with regions and groups.So:
- The initial form builder adds stubs for the rows, and a '#regions' property.
- A row can be marked as a group.
- Other modules can add rows and regions using hook_form_alter() or possibly other ways.
- Later, a '#process' callback adds the weight fields and tabledrag controls.I'd say this will make the job easier for modules like field_group (contrib) and field_layout (core).
On the other hand, it could break existing versions of such modules, depending how it is done.i could start building this, but I am afraid this will be stuck in the sand..
- 🇩🇪Germany donquixote
In fact the form already uses the element type 'field_ui_table'.
It currently does not have a '#process' callback.
So we can easily add one, either directly to the element type, or in the form.
Still this would be a BC break, I think.