- Issue created by @AlbionBrown
I have two group types and configured them so one can be added as content to the other using a GroupContentEnabler plugin. Simply being a parent group > sub group concept.
When creating nodes using the entitygroupfield, I can easily add the entity directly to a group when first creating the node when the entitygroupfield's been added in the display configuration. However, when creating a group, it cannot be added directly to another group because the GroupController::addForm() method sets a form state storage value for group_wizard_id
. When the entitygroupfield widget is being constructed, the EntityGroupFieldWidgetBase::formMultipleElements() method checks if a group_wizard_id
value is set in the form state storage and if so, just returns immediately.
I was wondering what the purpose of this is?
Commenting the lines
if ($form_state->get('group_wizard_id')) {
return [];
}
out of the top of the formMultipleElements() method doesn't seem to break anything and allows a Group entity to be added to another Group entity on creation.
Removed the first 3 lines of EntityGroupFieldWidgetBase::formMultipleElements()
Active
2.0
Widgets