Skip to content
Snippets Groups Projects

Add value to form parents to namespace component forms

@@ -164,6 +164,12 @@ abstract class ComponentFormBase extends FormBase implements ComponentFormInterf
FormStateInterface $form_state,
string $form_display_mode = 'default') {
if (isset($form['#parents']) && is_array($form['#parents'])) {
$form['#parents'] = array_merge($form['#parents'], ['lpb_component_form']);
}
else {
$form['#parents'] = ['lpb_component_form'];
}
$this->initFormLangcodes($form_state);
$display = EntityFormDisplay::collectRenderDisplay($this->paragraph, $form_display_mode);
$display->buildForm($this->paragraph, $form, $form_state);
Loading