Skip to content
Snippets Groups Projects
Commit bbb9e4c5 authored by Justin Toupin's avatar Justin Toupin Committed by Justin Toupin
Browse files

Issue #3160806 by justin2pin: Inline Entity Form (IEF) Compatibility

parent 674b2865
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,8 @@ use Drupal\paragraphs\ParagraphsTypeInterface;
use Drupal\layout_paragraphs\Ajax\LayoutParagraphsStateResetCommand;
use Drupal\layout_paragraphs\Ajax\LayoutParagraphsInsertCommand;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\inline_entity_form\ElementSubmit;
use Drupal\inline_entity_form\WidgetSubmit;
/**
* Entity Reference with Layout field widget.
......@@ -1160,7 +1162,7 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi
'#weight' => 1000,
'#type' => 'actions',
'#attributes' => ['class' => ['layout-paragraphs-item-form-actions']],
'save_item' => [
'submit' => [
'#type' => 'submit',
'#name' => 'save',
'#value' => $this->t('Save'),
......@@ -1237,6 +1239,14 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi
}
}
}
// Add compatibility for Inline Entity Form module.
// See https://www.drupal.org/project/inline_entity_form/issues/3160809
// and https://www.drupal.org/project/layout_paragraphs/issues/3160806
$ief_widget_state = $form_state->get('inline_entity_form');
if (!is_null($ief_widget_state)) {
ElementSubmit::attach($element['entity_form'], $form_state);
WidgetSubmit::attach($element['entity_form'], $form_state);
}
return $element;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment