Skip to content

Commit

Permalink
Do not try to load any values if it's not an mp_form
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Dec 6, 2023
1 parent 0b55f8d commit a045219
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/EventListener/LoadFormFieldListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ public function __invoke(Widget $widget, string $formId, array $formData, Form $
return $widget;
}

$postData = new ParameterBag($_POST);

$manager = $this->formManagerFactory->forFormId((int) $form->id);

if (!$manager->isValidFormFieldCombination()) {
return $widget;
}

$postData = new ParameterBag($_POST);
$stepData = $manager->getDataOfCurrentStep();

// We only prefill the value if it was not submitted in this step.
Expand Down

0 comments on commit a045219

Please # to comment.