- Issue created by @apmsooner
We can reduce code in various widgets by passing down the form array parents structure as a property on the element. This can be used for unique name keys for ajax buttons, limit_validation_errors, wrapper ids, etc...
In CustomFieldWidgetBase, add the logic for:
$parents = $form['#parents'];
$field_parents = array_merge($parents, [$field_name, $delta, $field->getName()]);
And then set it as a property value on the element:
'#field_properties' => $field_parents
Audit widgets where this can be adopted and reduce unnecessary code.
Active
3.1
Code