Skip to content

Commit e1ca6fe

Browse files
committed
Issue #2980694 followup: Remove the initial offer config form when unsetting the offer.
1 parent 1c66c41 commit e1ca6fe

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

modules/promotion/src/Form/PromotionForm.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public function form(array $form, FormStateInterface $form_state) {
9292
if ($this->entity->isNew() && !empty($form['offer']['widget'][0]['target_plugin_id'])) {
9393
$form['offer']['widget'][0]['target_plugin_id']['#empty_value'] = '';
9494
$form['offer']['widget'][0]['target_plugin_id']['#default_value'] = '';
95+
if (!$form_state->isRebuilding()) {
96+
unset($form['offer']['widget'][0]['target_plugin_configuration']);
97+
}
9598
}
9699

97100
return $form;

0 commit comments

Comments
 (0)