Skip to content
Snippets Groups Projects
Commit e142a427 authored by Petar Gnjidic's avatar Petar Gnjidic Committed by Andrii Podanenko
Browse files

Issue #3002628 by jamiehollern, petar.gnjidic: Allow inline entity form submit...

Issue #3002628 by jamiehollern, petar.gnjidic: Allow inline entity form submit handler to return the saved entity
parent 0e05aff2
No related branches found
No related tags found
No related merge requests found
......@@ -177,13 +177,17 @@ class InlineEntityForm extends RenderElement {
* The entity form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return Drupal\Core\Entity\EntityInterface\null
*/
public static function submitEntityForm(array &$entity_form, FormStateInterface $form_state) {
$inline_form_handler = static::getInlineFormHandler($entity_form['#entity_type']);
$inline_form_handler->entityFormSubmit($entity_form, $form_state);
if ($entity_form['#save_entity']) {
$inline_form_handler->save($entity_form['#entity']);
return $entity_form['#entity'];
}
return NULL;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment