Skip to content

Commit 177d3f7

Browse files
AdamPSmglaman
authored andcommitted
Issue #3035155 by AdamPS, ToneLoc, mglaman, demonde, bojanz, stephenplatz: Allow "Single variations" widget to be used inside Complex Inline Entity Forms
1 parent 3e85eaa commit 177d3f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/product/src/Plugin/Field/FieldWidget/SingleVariationWidget.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ public function extractFormValues(FieldItemListInterface $items, array $form, Fo
152152
return;
153153
}
154154

155-
$parents = array_merge($form['#parents'], [$this->fieldDefinition->getName(), 'widget']);
155+
$parents = [$this->fieldDefinition->getName(), 'widget'];
156+
if ($form['#type'] != 'inline_entity_form') {
157+
$parents = array_merge($form['#parents'], $parents);
158+
}
156159
$element = NestedArray::getValue($form, $parents);
157160
/** @var \Drupal\commerce\Plugin\Commerce\InlineForm\EntityInlineFormInterface $inline_form */
158161
$inline_form = $element['entity']['#inline_form'];

0 commit comments

Comments
 (0)