*/
public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $plugin_id = NULL) {
// Only generate a new component once per form submission.
- if (!$component = $form_state->getTemporaryValue('layout_builder__component')) {
+ if (!$component = $form_state->get('layout_builder__component')) {
$component = new SectionComponent($this->uuidGenerator->generate(), $region, ['id' => $plugin_id]);
$section_storage->getSection($delta)->appendComponent($component);
- $form_state->setTemporaryValue('layout_builder__component', $component);
+ $form_state->set('layout_builder__component', $component);
}
return $this->doBuildForm($form, $form_state, $section_storage, $delta, $component);
}