|
@@ -18,7 +18,7 @@ discard block |
|
|
block discarded – undo |
|
18
|
18
|
/** |
|
19
|
19
|
* Implements hook_inline_entity_form_reference_form_alter(). |
|
20
|
20
|
*/ |
|
21
|
|
-function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, FormStateInterface &$form_state) { |
|
|
21
|
+function entity_browser_entity_form_inline_entity_form_reference_form_alter(&$reference_form, FormStateInterface&$form_state) { |
|
22
|
22
|
/** @var \Drupal\field\FieldConfigInterface $instance */ |
|
23
|
23
|
$instance = $form_state->get([ |
|
24
|
24
|
'inline_entity_form', |
|
@@ -31,7 +31,7 @@ discard block |
|
|
block discarded – undo |
|
31
|
31
|
$target_bundle = $instance->getTargetBundle() ?: $target_entity_type_id; |
|
32
|
32
|
|
|
33
|
33
|
/** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $form_display */ |
|
34
|
|
- $entity_form_id = $target_entity_type_id . '.' . $target_bundle . '.default'; |
|
|
34
|
+ $entity_form_id = $target_entity_type_id.'.'.$target_bundle.'.default'; |
|
35
|
35
|
// TODO - 'default' might become configurable or something else in the future. |
|
36
|
36
|
// See https://www.drupal.org/node/2510274 |
|
37
|
37
|
$form_display = $entity_form_display_storage->load($entity_form_id); |
|
@@ -137,7 +137,7 @@ discard block |
|
|
block discarded – undo |
|
137
|
137
|
$ief_id = $reference_form['#ief_id']; |
|
138
|
138
|
$form_values = NestedArray::getValue($form_state->getValues(), $reference_form['#parents']); |
|
139
|
139
|
$attach_entities = EntityBrowserElement::processEntityIds($form_values['entity_browser']['entity_ids']); |
|
140
|
|
- $entities =& $form_state->get(['inline_entity_form', $ief_id, 'entities']); |
|
|
140
|
+ $entities = & $form_state->get(['inline_entity_form', $ief_id, 'entities']); |
|
141
|
141
|
|
|
142
|
142
|
// Determine the correct weight of the new element. |
|
143
|
143
|
$weight = 0; |